API Guides > ConceptRT 3.x
BasePersistent Class Referenceabstract

Base class for persistent. More...

Detailed Description

Base class for persistent.

+ Inheritance diagram for BasePersistent:

Public Member Methods

void Lock ()
 Locks this object. More...
 
void Unlock ()
 Unlocks this object. More...
 
void NotifyChange ()
 Notify that the persistent value has changed. More...
 
const StringGetPersistentName () const
 Gets the peristent file name . More...
 
String GetPersistentFilePath () const
 Gets the peristent file path . More...
 
bool GetDefined () const
 Query if the persistent has been defined . More...
 
Int32 GetPersistentIdentifier () const
 Gets the persistent auto identifier. More...
 
void Invoke (const DynamicInvocationRequest &request, DynamicInvocationResult &result)
 Invokes the object fields and methods. More...
 
bool HasChanged () const
 Query if the persistent has been changed. More...
 
- Public Member Methods inherited from Service< BasePersistent, PriorityBelowNormal >
 Service ()
 Constuctor. More...
 
virtual ~Service ()
 Destructor. More...
 
- Public Member Methods inherited from BaseService
 BaseService (BaseServiceController &serviceController)
 Constuctor. More...
 
void SetPeriod (TimeSpan period)
 Set the period of the service. More...
 
TimeSpan GetPeriod () const
 Gets the service period. More...
 

Protected Member Functions

 BasePersistent ()
 Default constructor. More...
 
bool Define (PCChar8 persistentName, bool diagnoseMissingFile)
 Define the persistent. More...
 
void CyclicExecute ()
 Cyclic execution of the service. More...
 
void FinalExecute ()
 Final execution of the service. More...
 
virtual void ReadFrom (IDataStore &dataStore, IMessageCollector *messages=NULL)=0
 Reads from. More...
 
virtual void WriteTo (IDataStore &dataStore) const =0
 Writes to. More...
 
- Protected Member Functions inherited from BaseService
virtual void InitialExecute ()
 Initial execution of the service. More...
 
void UnregisterServiceController ()
 Method used by inherited class to unregister the service controller. More...
 
void RegisterServiceController ()
 Method used by inherited class to register the service controller once completely created. More...
 

Constructor & Destructor Documentation

Methods Documentation

void CyclicExecute ( )
protectedvirtual

Cyclic execution of the service.

Note
The execution should not block the caller thread.
RT Exceptions:

RT_ERROR_PERSISTENT_NOT_ABLE_OPEN_FILE

RT_ERROR_PERSISTENT_NOT_DEFINED

Implements BaseService.

bool Define ( PCChar8  persistentName,
bool  diagnoseMissingFile 
)
protected

Define the persistent.

Parameters
persistentNameName of the persistent. Must be unique!
diagnoseMissingFileDiagnose a message when the file is not already created.
Returns
true if successfuly loaded
void FinalExecute ( )
protectedvirtual

Final execution of the service.

RT Exceptions:
RT_ERROR_PERSISTENT_NOT_ABLE_OPEN_FILE

Reimplemented from BaseService.

bool GetDefined ( ) const
inline

Query if the persistent has been defined .

Returns
True if yes, no if not.
String GetPersistentFilePath ( ) const

Gets the peristent file path .

Returns
The peristent file path.
Int32 GetPersistentIdentifier ( ) const
inline

Gets the persistent auto identifier.

Returns
The persistent auto identifier.

Creation order is used to define the value of the auto identifier. Very useful to identify non defined persistents. See PersistenceDiagnostic.

const String& GetPersistentName ( ) const

Gets the peristent file name .

Returns
The peristent file name.
bool HasChanged ( ) const

Query if the persistent has been changed.

Returns
True if yes, no if not.
Version
3.3.2 or greater feature.
void Invoke ( const DynamicInvocationRequest request,
DynamicInvocationResult result 
)
virtual

Invokes the object fields and methods.

Parameters
requestThe request.
result[in,out] The result.

Dynamic Invocation on IInvocable objects enables us to have remote access on published fields and methods.

Implements IInvocable.

void Lock ( )
virtual

Locks this object.

Implements ILockable.

void NotifyChange ( )

Notify that the persistent value has changed.

This method is normally called by inner mechanisms.

virtual void ReadFrom ( IDataStore dataStore,
IMessageCollector messages = NULL 
)
protectedpure virtual
void Unlock ( )
virtual

Unlocks this object.

Implements ILockable.

virtual void WriteTo ( IDataStore dataStore) const
protectedpure virtual

Writes to.

Parameters
dataStore[in,out] The dataStore.

Implemented in Persistent__< DataType >.