RDK2::Object Class Reference

#include <object.h>

Inherits RDK2::Serialization::Readable, RDK2::Serialization::Writable, and RDK2::Demangle::Reflective.

Inherited by RDK2::UnitTest::ArrayInt< double >, RDK2::UnitTest::ArrayInt< float >, RDK2::UnitTest::ArrayInt< int16_t >, RDK2::UnitTest::ArrayInt< int32_t >, RDK2::UnitTest::ArrayInt< int8_t >, RDK2::UnitTest::ArrayInt< uint8_t >, RDK2::Meta::ObjectDiff, RDK2::RAgent::ModuleConfig, RDK2::RAgent::Pair, RDK2::RAgent::RAgentConfig, RDK2::RepositoryNS::RObjectPipeQueue, RDK2::RepositoryNS::RPropertyDef, RDK2::RepositoryNS::RPropertyUpdate, RDK2::RepositoryNS::RRemoteSubscription, RDK2::RGeometry::RPoint2d, RDK2::RGeometry::RPoint2i, RDK2::RGeometry::RPoint2od, RDK2::RGeometry::RPoint3d, RDK2::RGeometry::RPoint3od, RDK2::RGeometry::RQuaterniond, RDK2::RGraphics::RC8Set, RDK2::RGraphics::RImage, RDK2::RGraphics::RImagePointC8, RDK2::RGraphics::RPoseVector, RDK2::RMaps::RFeatureOnMap, RDK2::RMaps::RFrontier, RDK2::RMaps::RHbdScanResult, RDK2::RMaps::RItemOnMap, RDK2::RMaps::RMapImage, RDK2::RMaps::RPathAnswer, RDK2::RMaps::RPathRequest, RDK2::RMaps::RTopologicalFrontier, RDK2::RNetObjects::RNetMessage, RDK2::RNetObjects::RYellowPages, RDK2::RPrimitive::RPrimitive< T >, RDK2::RPrimitive::RString, RDK2::RSensorData::RActuaData, RDK2::RSensorData::RBlobData, RDK2::RSensorData::RIrcData, RDK2::RSensorData::RJoystickStatus, RDK2::RSensorData::RLaserData, RDK2::RSensorData::ROdometryData, RDK2::RSensorData::ROdometryDataWithSpeed, RDK2::RSensorData::RPantiltData, RDK2::RSensorData::RSonarData, RDK2::RSensorData::RStereoImageHeightsData, RDK2::RSensorData::RTemperatureData, RDK2::RSensorData::RTouchSensorData, RDK2::RSensorData::RUsarInuData, RDK2::RSensorData::RUsarRfidData, RDK2::RSensorData::RUsarVictimData, RDK2::RSensorData::RUsarVictimRfidData, RDK2::RSensorData::RXsensData, RDK2::UnitTest::ArrayInt< T >, RDK2::UnitTest::Complex1, RDK2::UnitTest::Complex2, RDK2::UnitTest::Complex3, RDK2::UnitTest::Complex6, RDK2::UnitTest::Complex7, RDK2::UnitTest::Data1, RDK2::UnitTest::EmptyClass, RDK2::UnitTest::EmptyVersion, RDK2::UnitTest::IntWrapper, RDK2::UnitTest::String1, RDK2::UnitTest::StringAndData1, RDK2::UnitTest::VersionTest, RDK2::RPrimitive::RPrimitive< bool >, RDK2::RPrimitive::RPrimitive< double >, and RDK2::RPrimitive::RPrimitive< int >.

Collaboration diagram for RDK2::Object:

Collaboration graph
[legend]

Detailed Description

La nuova e purificata RDK2::Object.

Rules and conventions about RDK2::Objects:
Every subclass should implement clone().

Every subclass which is to be added in a factory must implement a constructor with no arguments.

Copying of RDK2::Objects occurs only with clone(), please do not rely on copy constructors, operator=, casts or other means. RDK2::Object are usually passed around as pointers.

Definition at line 52 of file object.h.


Public Member Functions

 Object ()
virtual ~Object ()
virtual Objectclone () const
const RDK2::Time::TimestampgetCreationTimestamp () const
const RDK2::Time::TimestampgetUpdateTimestamp () const
const string & getCreatorName () const
const string & getLastUpdaterName () const
void updateTimestamp (const std::string &updaterName="")
void updateTimestamp (const RDK2::Time::Timestamp &t, const std::string &updaterName="")
void setCreatorName (const std::string &creatorName)
Serialization
Functions for dealing with serialization..

virtual void read (RDK2::Serialization::Reader *r) throw (RDK2::Serialization::ReadingException)
virtual void write (RDK2::Serialization::Writer *w) const throw (RDK2::Serialization::WritingException)
virtual void readObjectBody (RDK2::Serialization::Reader *r) throw (RDK2::Serialization::ReadingException)
virtual void writeObjectBody (RDK2::Serialization::Writer *w) const throw (RDK2::Serialization::WritingException)
Diffs
Functions for big objects; known big objects: Vector(s), RImage, RMapImage

virtual bool knowsDiffs ()
virtual bool applyDiff (const RDK2::Meta::ObjectDiff *)
virtual vector
< RDK2::Meta::ObjectDiff * > 
splitInDiffs (size_t)
StringRepresentationsAndVisualizations
Functions for dealing with string representation of the robjects..

virtual bool hasStringRepresentation () const
 Ritorna true se ha una rappresentazione "semplice" come stringa.
virtual std::string getStringRepresentation () const
 Ritorna la rappresentazione come stringa.
virtual bool loadFromStringRepresentation (const std::string &)
 Inversa della precedente.
virtual bool hasStringForVisualization () const
 Returns true if this object has a string that can be visualized.
virtual std::string getStringForVisualization () const
 Returns a string to be used to visualize the object.
TestSupport
TODO:

These functions are used by the built-in test system..

virtual std::vector< Object * > getTestCases () const
 Get a vector of test cases.
virtual bool equals (const Object *) const

Protected Attributes

RDK2::Time::Timestamp creationTimestamp
string creatorName
RDK2::Time::Timestamp upTimestamp
string lastUpdaterName

Constructor & Destructor Documentation

RDK2::Object::Object (  )  [inline]

Definition at line 57 of file object.h.

virtual RDK2::Object::~Object (  )  [inline, virtual]

Definition at line 58 of file object.h.


Member Function Documentation

Object * RDK2::Object::clone (  )  const [virtual]

Returns a copy of the object.

Returns:
0 if not implemented

Reimplemented in RDK2::Containers::Vector< RType >, RDK2::RAgent::Pair, RDK2::RAgent::RAgentConfig, RDK2::RepositoryNS::RPropertyUpdate, RDK2::RepositoryNS::RRemoteSubscription, RDK2::RGeometry::RPoint2d, RDK2::RGeometry::RPoint2i, RDK2::RGeometry::RPoint2od, RDK2::RGeometry::RPoint3d, RDK2::RGeometry::RPoint3od, RDK2::RGeometry::RQuaterniond, RDK2::RGraphics::RImage, RDK2::RGraphics::RImageDiffJpegPacket, RDK2::RGraphics::RImageDiffPoints, RDK2::RGraphics::RImageDiffRect, RDK2::RGraphics::RImagePointC8, RDK2::RMaps::RHbdScanResult, RDK2::RMaps::RMapImage, RDK2::RMaps::RMapImageDiffPoints, RDK2::RMaps::RMapImageDiffRect, RDK2::RMaps::RVictimOnMap, RDK2::RNetObjects::RNetMessage, RDK2::RPrimitive::RDouble, RDK2::RPrimitive::RString, RDK2::Containers::Vector< RDK2::RGeometry::RPoint2d >, RDK2::Containers::Vector< RDK2::RAgent::ModuleConfig >, and RDK2::Containers::Vector< RDK2::RAgent::Pair >.

Definition at line 52 of file object.cpp.

References RDK2::Demangle::Reflective::getClassName(), and RDK_ERROR_STREAM.

Referenced by RDK2::Containers::Vector< RDK2::RAgent::Pair >::append(), RDK2::RepositoryNS::RPropertyUpdate::clone(), RDK2::RNetObjects::RNetMessage::clone(), RDK2::Meta::Factory::Factory(), RDK2::RepositoryNS::Session::getObjectClone(), RDK2::RepositoryNS::Property::getObjectL(), RDK2::RepositoryNS::RemotePropertyManager::manageUpdateMessage(), RDK2::RNetObjects::RNetMessage::operator=(), RDK2::RNetObjects::RNetMessage::RNetMessage(), and RDK2::RepositoryNS::Repository::sendStorageValueToHost().

Here is the call graph for this function:

const RDK2::Time::Timestamp& RDK2::Object::getCreationTimestamp (  )  const [inline]

Definition at line 85 of file object.h.

References creationTimestamp.

const RDK2::Time::Timestamp& RDK2::Object::getUpdateTimestamp (  )  const [inline]

Definition at line 86 of file object.h.

References upTimestamp.

const string& RDK2::Object::getCreatorName (  )  const [inline]

Definition at line 87 of file object.h.

References creatorName.

const string& RDK2::Object::getLastUpdaterName (  )  const [inline]

Definition at line 88 of file object.h.

References lastUpdaterName.

void RDK2::Object::updateTimestamp ( const std::string &  updaterName = ""  )  [inline]

Definition at line 89 of file object.h.

References lastUpdaterName, RDK2::Time::Timestamp::setToNow(), and upTimestamp.

Referenced by RDK2::RepositoryNS::Session::valueChanged().

Here is the call graph for this function:

void RDK2::Object::updateTimestamp ( const RDK2::Time::Timestamp t,
const std::string &  updaterName = "" 
) [inline]

Definition at line 90 of file object.h.

References lastUpdaterName, and upTimestamp.

void RDK2::Object::setCreatorName ( const std::string &  creatorName  ) 

void RDK2::Object::read ( RDK2::Serialization::Reader r  )  throw (RDK2::Serialization::ReadingException) [virtual]

These default implementations of Writable and Readable serialize empty objects.

Implements RDK2::Serialization::Readable.

Reimplemented in RDK2::Containers::Vector< RType >, RDK2::RAgent::ModuleConfig, RDK2::RAgent::Pair, RDK2::RAgent::RAgentConfig, RDK2::RepositoryNS::RPropertyDef, RDK2::RepositoryNS::RPropertyUpdate, RDK2::RepositoryNS::RRemoteSubscription, RDK2::RGeometry::RPoint2d, RDK2::RGeometry::RPoint2i, RDK2::RGeometry::RPoint2od, RDK2::RGeometry::RPoint3d, RDK2::RGeometry::RPoint3od, RDK2::RGeometry::RQuaterniond, RDK2::RGraphics::RC8Set, RDK2::RGraphics::RImage, RDK2::RGraphics::RImageDiffJpegPacket, RDK2::RGraphics::RImageDiffPoints, RDK2::RGraphics::RImageDiffRect, RDK2::RGraphics::RImagePointC8, RDK2::RGraphics::RPoseVector, RDK2::RMaps::RfidTagOnMap, RDK2::RMaps::RFrontier, RDK2::RMaps::RHbdScanResult, RDK2::RMaps::RLandmark, RDK2::RMaps::RLine2dOnMap, RDK2::RMaps::RMapImage, RDK2::RMaps::RMapImageDiffPoints, RDK2::RMaps::RMapImageDiffRect, RDK2::RMaps::RPathAnswer, RDK2::RMaps::RPathRequest, RDK2::RMaps::RPoint2dOnMap, RDK2::RMaps::RPotentialVictimOnMap, RDK2::RMaps::RTopologicalFrontier, RDK2::RMaps::RVictimOnMap, RDK2::RNetObjects::RNetMessage, RDK2::RPrimitive::RBool, RDK2::RPrimitive::RDouble, RDK2::RPrimitive::RInt, RDK2::RPrimitive::RString, RDK2::RSensorData::RActuaData, RDK2::RSensorData::RJoystickStatus, RDK2::RSensorData::RLaserData, RDK2::RSensorData::RSonarData, RDK2::RSensorData::RTemperatureData, RDK2::RSensorData::RTouchSensorData, RDK2::RSensorData::RUsarInuData, RDK2::RSensorData::RUsarRfidData, RDK2::RSensorData::RUsarVictimData, RDK2::RSensorData::RUsarVictimRfidData, RDK2::RSensorData::RXsensData, RDK2::Containers::Vector< RDK2::RGeometry::RPoint2d >, RDK2::Containers::Vector< RDK2::RAgent::ModuleConfig >, and RDK2::Containers::Vector< RDK2::RAgent::Pair >.

Definition at line 26 of file object.cpp.

References RDK2::Demangle::Reflective::getClassName(), and RDK_ERROR_STREAM.

Here is the call graph for this function:

void RDK2::Object::write ( RDK2::Serialization::Writer  )  const throw (RDK2::Serialization::WritingException) [virtual]

Function to be implemented by objects wishing to serialize themselves.

Here are some assumptions:

  • the object must call startWriting(), then output his data with the writeXXX functions, and then end with endWriting()
  • the object must let the exceptions generated by the Writer to pass through, as the writer will take care of them.
  • to serialize a sub-object, use the writeObject function.

Implements RDK2::Serialization::Writable.

Reimplemented in RDK2::Containers::Vector< RType >, RDK2::RAgent::ModuleConfig, RDK2::RAgent::Pair, RDK2::RAgent::RAgentConfig, RDK2::RepositoryNS::RPropertyDef, RDK2::RepositoryNS::RPropertyUpdate, RDK2::RepositoryNS::RRemoteSubscription, RDK2::RGeometry::RPoint2d, RDK2::RGeometry::RPoint2i, RDK2::RGeometry::RPoint2od, RDK2::RGeometry::RPoint3d, RDK2::RGeometry::RPoint3od, RDK2::RGeometry::RQuaterniond, RDK2::RGraphics::RC8Set, RDK2::RGraphics::RImage, RDK2::RGraphics::RImageDiffJpegPacket, RDK2::RGraphics::RImageDiffPoints, RDK2::RGraphics::RImageDiffRect, RDK2::RGraphics::RImagePointC8, RDK2::RGraphics::RPoseVector, RDK2::RMaps::RfidTagOnMap, RDK2::RMaps::RFrontier, RDK2::RMaps::RHbdScanResult, RDK2::RMaps::RLandmark, RDK2::RMaps::RLine2dOnMap, RDK2::RMaps::RMapImage, RDK2::RMaps::RMapImageDiffPoints, RDK2::RMaps::RMapImageDiffRect, RDK2::RMaps::RPathAnswer, RDK2::RMaps::RPathRequest, RDK2::RMaps::RPoint2dOnMap, RDK2::RMaps::RPotentialVictimOnMap, RDK2::RMaps::RTopologicalFrontier, RDK2::RMaps::RVictimOnMap, RDK2::RNetObjects::RNetMessage, RDK2::RPrimitive::RBool, RDK2::RPrimitive::RDouble, RDK2::RPrimitive::RInt, RDK2::RPrimitive::RString, RDK2::RSensorData::RActuaData, RDK2::RSensorData::RJoystickStatus, RDK2::RSensorData::RLaserData, RDK2::RSensorData::RSonarData, RDK2::RSensorData::RTemperatureData, RDK2::RSensorData::RTouchSensorData, RDK2::RSensorData::RUsarInuData, RDK2::RSensorData::RUsarRfidData, RDK2::RSensorData::RUsarVictimData, RDK2::RSensorData::RUsarVictimRfidData, RDK2::RSensorData::RXsensData, RDK2::Containers::Vector< RDK2::RGeometry::RPoint2d >, RDK2::Containers::Vector< RDK2::RAgent::ModuleConfig >, and RDK2::Containers::Vector< RDK2::RAgent::Pair >.

Definition at line 32 of file object.cpp.

References RDK2::Demangle::Reflective::getClassName(), and RDK_ERROR_STREAM.

Here is the call graph for this function:

void RDK2::Object::readObjectBody ( RDK2::Serialization::Reader r  )  throw (RDK2::Serialization::ReadingException) [virtual]

These functions are helper for derived class They do should contain real reading and writing of object member

Definition at line 38 of file object.cpp.

References creationTimestamp, RDK2::Statistics::r, RDK2::Time::Timestamp::setMsFromMidnight(), and upTimestamp.

Referenced by RDK2::RGeometry::RPoint2od::read(), and RDK2::RMaps::RLandmark::read().

Here is the call graph for this function:

void RDK2::Object::writeObjectBody ( RDK2::Serialization::Writer w  )  const throw (RDK2::Serialization::WritingException) [virtual]

Definition at line 46 of file object.cpp.

References creationTimestamp, RDK2::Time::Timestamp::getMsFromMidnight(), and upTimestamp.

Referenced by RDK2::RGeometry::RPoint2od::write(), and RDK2::RMaps::RLandmark::write().

Here is the call graph for this function:

virtual bool RDK2::Object::knowsDiffs (  )  [inline, virtual]

virtual bool RDK2::Object::applyDiff ( const RDK2::Meta::ObjectDiff  )  [inline, virtual]

virtual vector<RDK2::Meta::ObjectDiff*> RDK2::Object::splitInDiffs ( size_t   )  [inline, virtual]

virtual bool RDK2::Object::hasStringRepresentation (  )  const [inline, virtual]

std::string RDK2::Object::getStringRepresentation (  )  const [virtual]

virtual bool RDK2::Object::loadFromStringRepresentation ( const std::string &   )  [inline, virtual]

virtual bool RDK2::Object::hasStringForVisualization (  )  const [inline, virtual]

std::string RDK2::Object::getStringForVisualization (  )  const [virtual]

virtual std::vector<Object*> RDK2::Object::getTestCases (  )  const [inline, virtual]

Get a vector of test cases.

Reimplemented in RDK2::RGeometry::RPoint2od, RDK2::RNetObjects::RNetMessage, and RDK2::RPrimitive::RString.

Definition at line 146 of file object.h.

Referenced by main().

virtual bool RDK2::Object::equals ( const Object  )  const [inline, virtual]

Compare this and another object.

Note:
For clarity, we decided not to use operator=.
Returns:
true if they are equivalent

Reimplemented in RDK2::RGeometry::RPoint2od, RDK2::RNetObjects::RNetMessage, and RDK2::RPrimitive::RString.

Definition at line 153 of file object.h.

Referenced by RDK2::RNetObjects::RNetMessage::equals(), and main().


Field Documentation

This member is the timestamp when the object is created it is const and the default constructor initialize it to the current timestamp

Definition at line 70 of file object.h.

Referenced by getCreationTimestamp(), readObjectBody(), and writeObjectBody().

string RDK2::Object::creatorName [protected]

This member is the name of the creator of this object (e.g., the session that created this object) this has to be set by hand

Definition at line 74 of file object.h.

Referenced by getCreatorName().

This member is the timestamp of last update performed on object, should be updated every time a property of the object changes

Definition at line 78 of file object.h.

Referenced by getUpdateTimestamp(), readObjectBody(), updateTimestamp(), and writeObjectBody().

string RDK2::Object::lastUpdaterName [protected]

This member is the name of the last updater of this object (e.g., the session the modified this object) this has to be set using the functions updateTimestamp with the second parameter

Definition at line 82 of file object.h.

Referenced by getLastUpdaterName(), and updateTimestamp().


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

Generated on Tue Mar 3 15:05:44 2009 for OpenRDK by  doxygen 1.5.6