cmlabs::CMObject Class Reference

#include <CogMapObjects.h>

Inheritance diagram for cmlabs::CMObject:

Inheritance graph
[legend]
Collaboration diagram for cmlabs::CMObject:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CMObject ()
 CMObject (const JString &xml)
 CMObject (XMLNode *node)
 ~CMObject ()
Objectclone () const
bool equals (const Object *o) const
bool equals (const CMObject &p) const
bool equals (const CMObject *p) const
bool fromXML (const JString &xml)
bool fromXML (XMLNode *node)
JString toXML ()
JString print ()
JString toHTML ()
bool unitTest ()
CMObjectoperator- (CMObject *otherObject)
const CMObjectoperator+= (CMObject *otherObject)
CMObjectgetDifferenceSince (CMObject *otherObject)
CMObjectgetDifferenceSinceIfAny (CMObject *otherObject)
bool addDifference (CMObject *otherObject)
bool hasProperty (const JString &name)
JString getPropertyType (const JString &name)
bool removeProperty (const JString &name)
JString getPropertyString (const JString &name)
int getPropertyInteger (const JString &name)
double getPropertyDouble (const JString &name)
ObjectgetPropertyObject (const JString &name)
JString get (const JString &prop)
bool setPropertyString (const JString &name, const JString &value)
bool setPropertyInteger (const JString &name, int value)
bool setPropertyDouble (const JString &name, double value)
bool setPropertyObject (const JString &name, Object *value, const JString &type)
long getBinarySize (int chunk)
 Get the size of any binary data.
int getBinaryChunkCount ()
 Get the number of data chunks.
long toBinaryBuffer (int chunk, char *buffer, int maxlen)
 Get a pointer to the binary data at chunk number 'chunk'.
bool fromBinaryBuffer (int chunk, char *buffer, long len)
 Set the data after separate reception.

Public Attributes

JString id
JString type
JString parentID
CMObjectparent
ObjectDictionary children
ObjectDictionary properties
Dictionary propertyTypes
CMPoint pos
CMMeasurement oriX
CMMeasurement oriY
CMMeasurement oriZ
CMMeasurement oriW
CMMeasurement velX
CMMeasurement velY
CMMeasurement velZ
CMMeasurement boxW
CMMeasurement boxH
CMMeasurement boxD
JTime createdTime


Detailed Description

Definition at line 1564 of file CogMapObjects.h.


Constructor & Destructor Documentation

cmlabs::CMObject::CMObject (  ) 

public overloaded constructor CMObject The CMObject method creates a new CMObject

	       new CMObject();
	    

This function doesn't return a value

Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 598 of file CogMapObjects.cpp.

cmlabs::CMObject::CMObject ( const JString xml  ) 

public overloaded constructor CMObject The CMObject method creates a new CMObject from raw XML

	       new CMObject(xml);
	    

Parameters:
[in] xml type const JString & raw XML text
This function doesn't return a value

Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 603 of file CogMapObjects.cpp.

cmlabs::CMObject::CMObject ( XMLNode node  ) 

public overloaded constructor CMObject The CMObject method creates a new CMObject from an XML Node

	       new CMObject(node);
	    

Parameters:
[in,out] node type XMLNode * XML Node containing XML
This function doesn't return a value

Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 609 of file CogMapObjects.cpp.

cmlabs::CMObject::~CMObject (  ) 

public virtual destructor ~CMObject The ~CMObject method destroys a CMObject

	       delete(obj);
	    

This function doesn't return a value

Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 615 of file CogMapObjects.cpp.


Member Function Documentation

Object * cmlabs::CMObject::clone (  )  const [virtual]

public virtual constant clone The clone method creates an identical object by cloning

	       val = (CMObject*) obj->clone();
	    

Returns:
  • Object * containing object if successful, or
  • NULL if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Implements cmlabs::Object.

Definition at line 618 of file CogMapObjects.cpp.

bool cmlabs::CMObject::equals ( const Object o  )  const [virtual]

public virtual overloaded constant equals The equals method tests if two objects are equal

	       val = obj->equals(obj);
	    

Parameters:
[in] o type const Object * object to test
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 644 of file CogMapObjects.cpp.

bool cmlabs::CMObject::equals ( const CMObject p  )  const

public virtual overloaded constant equals The equals method tests if two objects are equal

	       val = obj->equals(obj);
	    

Parameters:
[in] o type const CMObject & object to test
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 651 of file CogMapObjects.cpp.

bool cmlabs::CMObject::equals ( const CMObject p  )  const

public virtual overloaded constant equals The equals method tests if two objects are equal

	       val = obj->equals(obj);
	    

Parameters:
[in] o type const CMObject * object to test
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 655 of file CogMapObjects.cpp.

bool cmlabs::CMObject::fromXML ( const JString xml  )  [virtual]

public virtual overloaded fromXML The fromXML method fills in the object with the content of the XML

	       val = obj->fromXML(xml);
	    

Parameters:
[in] xml type const JString & raw XML
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 701 of file CogMapObjects.cpp.

bool cmlabs::CMObject::fromXML ( XMLNode node  )  [virtual]

public virtual fromXML The fromXML method instantiates the object from XML

	       val = obj->fromXML(xmlnode);
	    

Parameters:
[in,out] node type XMLNode * XMLNode containing XML
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 713 of file CogMapObjects.cpp.

JString cmlabs::CMObject::toXML (  )  [virtual]

public virtual toXML The toXML method generates the XML representing the object

	       val = obj->toXML();
	    

Returns:
  • JString containing XML if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 752 of file CogMapObjects.cpp.

JString cmlabs::CMObject::print (  )  [virtual]

public constant print The print method creates a string representation of the object

	       val = obj->print();
	    

Returns:
  • JString containing text if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 780 of file CogMapObjects.cpp.

JString cmlabs::CMObject::toHTML (  )  [virtual]

public virtual toHTML The toHTML method creates HTML which represents the object

	       val = obj->toHTML();
	    

Returns:
  • JString containing HTML string if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 776 of file CogMapObjects.cpp.

bool cmlabs::CMObject::unitTest (  )  [virtual]

public virtual unitTest The unitTest method runs the object's unit tests

	       val = obj->unitTest();
	    

Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Reimplemented from cmlabs::Object.

Definition at line 1068 of file CogMapObjects.cpp.

CMObject * cmlabs::CMObject::operator- ( CMObject otherObject  ) 

public operator - The operator - method returns the difference between two CMObjects

	       val = obj - obj2;
	    

Parameters:
[in,out] otherObject type CMObject * CMObject to compare with
Returns:
  • CMObject * containing the difference object if successful, or
  • NULL if no difference.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 845 of file CogMapObjects.cpp.

const CMObject & cmlabs::CMObject::operator+= ( CMObject otherObject  ) 

public operator += The operator += method adds the information from another CMObject

	       val += obj;
	    

Parameters:
[in,out] otherObject type CMObject * CMObject to add
Returns:
  • const CMObject & containing self if successful, or
  • unmodified self if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 849 of file CogMapObjects.cpp.

CMObject * cmlabs::CMObject::getDifferenceSince ( CMObject otherObject  ) 

public getDifferenceSince The getDifferenceSince method returns the difference between the two objects

	       val = obj->getDifferenceSince(obj);
	    

Parameters:
[in,out] otherObject type CMObject * CMObject to compare with
Returns:
  • CMObject * containing difference object

Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 854 of file CogMapObjects.cpp.

CMObject * cmlabs::CMObject::getDifferenceSinceIfAny ( CMObject otherObject  ) 

public getDifferenceSinceIfAny The getDifferenceSinceIfAny method returns the difference between the two objects or NULL if there are no difference

	       val = obj->getDifferenceSinceIfAny(obj);
	    

Parameters:
[in,out] otherObject type CMObject * CMObject to compare with
Returns:
  • CMObject * containing difference object if successful, or
  • NULL if no difference.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 864 of file CogMapObjects.cpp.

bool cmlabs::CMObject::addDifference ( CMObject otherObject  ) 

public addDifference The addDifference method add the values from a CMObject update

	       val = obj->addDifference(obj);
	    

Parameters:
[in,out] otherObject type CMObject * CMObject with values to add
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 964 of file CogMapObjects.cpp.

bool cmlabs::CMObject::hasProperty ( const JString name  ) 

public hasProperty The hasProperty method checks if a property exists

	       val = obj->hasProperty(name);
	    

Parameters:
[in] name type const JString & name of property to check
Returns:
  • bool containing true if property exists, or
  • false if not.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 784 of file CogMapObjects.cpp.

JString cmlabs::CMObject::getPropertyType ( const JString name  ) 

public getPropertyType The getPropertyType method returns the type name of a property

	       val = obj->getPropertyType(name);
	    

Parameters:
[in] name type const JString & name of property to check
Returns:
  • JString containing type string if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 788 of file CogMapObjects.cpp.

bool cmlabs::CMObject::removeProperty ( const JString name  ) 

public removeProperty The removeProperty method removes a stored named property

	       val = obj->removeProperty(name);
	    

Parameters:
[in] name type const JString & property name
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 792 of file CogMapObjects.cpp.

JString cmlabs::CMObject::getPropertyString ( const JString name  ) 

public getPropertyString The getPropertyString method returns the property content as a string

	       val = obj->getPropertyString(name);
	    

Parameters:
[in] name type const JString & name of property
Returns:
  • JString containing content if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 798 of file CogMapObjects.cpp.

int cmlabs::CMObject::getPropertyInteger ( const JString name  ) 

public getPropertyInteger The getPropertyInteger method returns the property content as an integer

	       val = obj->getPropertyInteger(name);
	    

Parameters:
[in] name type const JString & name of property
Returns:
  • int containing value if successful, or
  • 0 if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 805 of file CogMapObjects.cpp.

double cmlabs::CMObject::getPropertyDouble ( const JString name  ) 

public getPropertyDouble The getPropertyDouble method returns the property content as a double value

	       val = obj->getPropertyDouble(name);
	    

Parameters:
[in] name type const JString & property name
Returns:
  • double containing value if successful, or
  • 0 if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 812 of file CogMapObjects.cpp.

Object * cmlabs::CMObject::getPropertyObject ( const JString name  ) 

public getPropertyObject The getPropertyObject method returns the property content as an object

	       val = obj->getPropertyObject(name);
	    

Parameters:
[in] name type const JString & property name
Returns:
  • Object * containing the object if successful, or
  • NULL if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 819 of file CogMapObjects.cpp.

JString cmlabs::CMObject::get ( const JString prop  ) 

public get The get method get a property by name

	       val = obj->get(name);
	    

Parameters:
[in] prop type const JString & property name
Returns:
  • JString containing property value if successful, or
  • empty string if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 1007 of file CogMapObjects.cpp.

bool cmlabs::CMObject::setPropertyString ( const JString name,
const JString value 
)

public setPropertyString The setPropertyString method set the named property

	       val = obj->setPropertyString(name, value);
	    

Parameters:
[in] name type const JString & property name
[in] value type const JString & new property value
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 824 of file CogMapObjects.cpp.

bool cmlabs::CMObject::setPropertyInteger ( const JString name,
int  value 
)

public setPropertyInteger The setPropertyInteger method sets the named property

	       val = obj->setPropertyInteger(name, value);
	    

Parameters:
[in] name type const JString & property name
[in] value type int new property value
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 829 of file CogMapObjects.cpp.

bool cmlabs::CMObject::setPropertyDouble ( const JString name,
double  value 
)

public setPropertyDouble The setPropertyDouble method sets a named property

	       val = obj->setPropertyDouble(name, value);
	    

Parameters:
[in] name type const JString & property name
[in] value type double new property value
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 834 of file CogMapObjects.cpp.

bool cmlabs::CMObject::setPropertyObject ( const JString name,
Object value,
const JString type 
)

public setPropertyObject The setPropertyObject method sets a named property

	       val = obj->setPropertyObject(name, object, type);
	    

Parameters:
[in] name type const JString & property name
[in,out] value type Object * property value as object
[in] type type const JString & object type string
Returns:
  • bool containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
18-05-2007

Definition at line 839 of file CogMapObjects.cpp.

long cmlabs::CMObject::getBinarySize ( int  chunk  )  [virtual]

Get the size of any binary data.

public virtual getBinarySize The getBinarySize method returns the size of binary chunk number 'chunk', use -1 for all chunks

	       val = obj->getBinarySize(2);
	    

Returns:
  • long containing the size in bytes
Remarks:
See also:
Author:
Thor List
Date:
20-01-2009

Reimplemented from cmlabs::Object.

Definition at line 1121 of file CogMapObjects.cpp.

int cmlabs::CMObject::getBinaryChunkCount (  )  [virtual]

Get the number of data chunks.

public virtual getBinaryChunkCount The getBinaryChunkCount method returns the number of binary chunks present

	       val = obj->getBinaryChunkCount();
	    

Returns:
  • int containing number of binary chunks.
Remarks:
See also:
Author:
Thor List
Date:
20-01-2009

Reimplemented from cmlabs::Object.

Definition at line 1126 of file CogMapObjects.cpp.

long cmlabs::CMObject::toBinaryBuffer ( int  chunk,
char *  buffer,
int  maxlen 
) [virtual]

Get a pointer to the binary data at chunk number 'chunk'.

public virtual toBinaryBuffer The toBinaryBuffer method writes a binary chunk to a buffer

	       val = obj->toBinaryBuffer(2, data, 1024);
	    

Returns:
  • long containing number of bytes written to buffer.
Remarks:
See also:
Author:
Thor List
Date:
20-01-2009
Write binary data to buffer at chunk number 'chunk'

Reimplemented from cmlabs::Object.

Definition at line 1131 of file CogMapObjects.cpp.

bool cmlabs::CMObject::fromBinaryBuffer ( int  chunk,
char *  buffer,
long  len 
) [virtual]

Set the data after separate reception.

public virtual fromBinaryBuffer The fromBinaryBuffer method sets the data after separate reception

	       val = obj->fromBinaryBuffer();
	    

Returns:
  • Boolean containing true if successful, or
  • false if unsuccessful.
Remarks:
See also:
Author:
Thor List
Date:
20-01-2009

Reimplemented from cmlabs::Object.

Definition at line 1136 of file CogMapObjects.cpp.


Member Data Documentation

JString id The id variable contains the id of the object

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2288 of file CogMapObjects.h.

JString type The type variable contains the type of the object

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2298 of file CogMapObjects.h.

Definition at line 2299 of file CogMapObjects.h.

CMObject * parent The parent variable contains the pointer to the parent object

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2309 of file CogMapObjects.h.

ObjectDictionary children The children variable contains the list of child CMObjects

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2319 of file CogMapObjects.h.

ObjectDictionary properties The properties variable contains a list of properties

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2329 of file CogMapObjects.h.

Dictionary propertyTypes The propertyTypes variable contains a dictionary of property names and types

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2339 of file CogMapObjects.h.

CMPoint pos The pos variable contains the position of the object

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2350 of file CogMapObjects.h.

Definition at line 2351 of file CogMapObjects.h.

Definition at line 2351 of file CogMapObjects.h.

Definition at line 2351 of file CogMapObjects.h.

Definition at line 2351 of file CogMapObjects.h.

Definition at line 2352 of file CogMapObjects.h.

Definition at line 2352 of file CogMapObjects.h.

Definition at line 2352 of file CogMapObjects.h.

Definition at line 2353 of file CogMapObjects.h.

Definition at line 2353 of file CogMapObjects.h.

Definition at line 2353 of file CogMapObjects.h.

JTime createdTime The createdTime variable contains the time of creation

Remarks:
Author:
Thor List
Date:
18-05-2007

Definition at line 2363 of file CogMapObjects.h.


The documentation for this class was generated from the following files:

Generated on Tue Jul 7 16:24:06 2009 for CoreLibrary by  doxygen 1.5.6