API Guides > ConceptRT 3.x
Persistent__< DataType > Class Template Reference

Base class for Persistent. More...

Detailed Description

template<class DataType>
class ConceptRT::Persistent__< DataType >

Base class for Persistent.

+ Inheritance diagram for Persistent__< DataType >:

Public Member Methods

DataType ReadLocked ()
 Reads the persistent value. More...
 
void WriteLocked (const DataType &value)
 Writes the persistent value. More...
 
- Public Member Methods inherited from BasePersistent
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...
 

Public Attributes

DataType _Value_Unlocked
 The persistent unlocked value. More...
 

Protected Member Functions

void WriteTo (IDataStore &dataStore) const
 Writes to. More...
 
- Protected Member Functions inherited from BasePersistent
 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...
 
- 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...
 

Methods Documentation

DataType ReadLocked ( )
inline

Reads the persistent value.

Returns
The persistent value.

Locked acces avoid concurrent access between application and persistence services.

Attention
This method is well designed to scalar variable access. Getting huge stucture with this method is not recommended : See persistent_read_lock.
RT Exceptions:
RT_ERROR_INTERNAL_NOT_ABLE_LOCK
void WriteLocked ( const DataType &  value)
inline

Writes the persistent value.

Parameters
valueThe persistent value.

Locked acces avoid concurrent access between application and persistence services.

Attention
This method is well designed to scalar variable access. Getting huge stucture with this method is not recommended : See persistent_write_lock.
void WriteTo ( IDataStore dataStore) const
inlineprotectedvirtual

Writes to.

Parameters
dataStore[in,out] The dataStore.

Implements BasePersistent.

Fields Documentation

DataType _Value_Unlocked

The persistent unlocked value.

Attention
Direct access is not recommanded whithout precautions (lock)
See also
Persistent::ReadLocked()
Persistent::WriteLocked()