#include <cel_datastore.h>
Public Member Functions | |
virtual AutoPtr< DataStore > | addDataStore (const String &inName, UChar4 pathSep= '\0')=0 |
virtual void | set (const String &inName, Serializable *inSerializable, UChar4 pathSep= '\0')=0 |
template<typename T > | |
void | setT (const String &inName, const T &inValue, UChar4 pathSep= '\0') |
virtual size_t | getSize () const =0 |
virtual String | getName (size_t inIndex) const =0 |
virtual AutoPtr< Serializable > | at (size_t inIndex)=0 |
virtual AutoPtr< const Serializable > | at (size_t inIndex) const =0 |
template<class T > | |
AutoPtr< T > | at (size_t inIndex) |
template<class T > | |
AutoPtr< const T > | at (size_t inIndex) const |
virtual AutoPtr< Serializable > | get (const String &inName, UChar4 pathSep= '\0')=0 |
virtual AutoPtr< const Serializable > | get (const String &inName, UChar4 pathSep= '\0') const =0 |
template<class T > | |
AutoPtr< T > | get (const String &inName, UChar4 pathSep= '\0') |
template<class T > | |
AutoPtr< const T > | get (const String &inName, UChar4 pathSep= '\0') const |
virtual void | unlink (const String &inName, UChar4 pathSep= '\0')=0 |
void | setProperty_U64 (const String &inName, uint64_t v, UChar4 pathSep= '\0') |
void | setProperty_I64 (const String &inName, int64_t v, UChar4 pathSep= '\0') |
void | setProperty_U32 (const String &inName, u32 v, UChar4 pathSep= '\0') |
void | setProperty_I32 (const String &inName, i32 v, UChar4 pathSep= '\0') |
void | setProperty_Double (const String &inName, double v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, size_t v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const char *v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const utf8s &v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const String &v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const Time &v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const TimeSpan &v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, const Guid &v, UChar4 pathSep= '\0') |
void | setProperty (const String &inName, Serializable *inSerializable, UChar4 pathSep= '\0') |
AutoPtr< DataStore > | getAsDataStore (const String &inName, UChar4 pathSep= '\0') |
AutoPtr< const DataStore > | getAsDataStore (const String &inName, UChar4 pathSep= '\0') const |
AutoPtr< BasicDataArray > | getAsDataArray (const String &inName, UChar4 pathSep= '\0') |
AutoPtr< const BasicDataArray > | getAsDataArray (const String &inName, UChar4 pathSep= '\0') const |
ssize_t | getAsInteger (const String &inName, UChar4 pathSep= '\0') const |
size_t | getAsUInteger (const String &inName, UChar4 pathSep= '\0') const |
int64_t | getAsInteger64 (const String &inName, UChar4 pathSep= '\0') const |
uint64_t | getAsUInteger64 (const String &inName, UChar4 pathSep= '\0') const |
double | getAsDouble (const String &inName, UChar4 pathSep= '\0') const |
String | getAsString (const String &inName, UChar4 pathSep= '\0') const |
Time | getAsTime (const String &inName, UChar4 pathSep= '\0') const |
TimeSpan | getAsTimeSpan (const String &inName, UChar4 pathSep= '\0') const |
Guid | getAsGUID (const String &inName, UChar4 pathSep= '\0') const |
bool | doesExist (const String &inName, UChar4 pathSep= '\0') const |
String | getClassOf (const String &inName, UChar4 pathSep= '\0') const |
const Guid & | getClassIdOf (const String &inName, UChar4 pathSep= '\0') const |
virtual void | instructNoChecksum ()=0 |
virtual AutoPtr< DataStore > | duplicateDataStore ()=0 |
Public Member Functions inherited from Celartem::Serializable | |
virtual void | serialize (Stream *inStream, size_t inLevel=0, Endian inEndian=endianBig)=0 |
virtual AutoPtr< Serializable > | duplicate () const =0 |
const Guid & | getClassId () const |
String | getClassName () const |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Static Public Member Functions | |
static AutoPtr< DataStore > | create () |
static AutoPtr< DataStore > | create (Stream *inStream) |
static AutoPtr< Serializable > | deserialize (Stream *inStream, size_t inLevel=0, Endian inEndian=endianBig) |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
DataStore is multi purpose container of Serializable objects. Since DataStore itself is also derived from Serializable, it can contain DataStore instances to form the tree structure. The instances that are held by DataStore instance are actually not stored in the instance but they are just linked by AutoPtr array.
This class also support the Serialization to Stream instance.
|
pure virtual |
Add child DataStore instance by the specified name. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new DataStore instance. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
pure virtual |
This method gets the object instance by index.
inIndex | Index of the object. |
Referenced by at().
|
pure virtual |
This method gets the object instance by index. (const version)
inIndex | Index of the object. |
|
inline |
This method gets the object instance by index.
inIndex | Index of the object. |
The following is a sample use of this method:
|
inline |
This method gets the object instance by index. (const version)
inIndex | Index of the object. |
The following is a sample use of this method:
Creates a new DataStore instance.
Creates a new DataStore instance from the stream.
This function is almost identical to deserialize function except it does only have a parameter that specifies the source stream. For more information, see deserialize.
inStream | A stream from which the serialization starts. |
|
static |
This function starts the serialization from the specified stream.
inStream | A stream from which the serialization starts. |
inLevel | The level of the object. If the objects has tree structure and the serialization process is to make recursion, the inLevel is incremented just before calling deserialize function of the child objects. If you are no the top level, set the value to 0. |
inEndian | The endianness used to read the data. |
Verifies whether there is the object of the specified name or not.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
true
if the object exists, otherwise false
. This function duplicates the DataStore instance.
|
pure virtual |
This method gets the object instance by name.
inName | Name or path of the object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
pure virtual |
This method gets the object instance by name. (const version)
inName | Name or path of the object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
inline |
This method gets the object instance by name.
inName | Name or path of the object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
The following is a sample use of this method:
|
inline |
This method gets the object instance by name. (const version)
inName | Name or path of the object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
The following is a sample use of this method:
AutoPtr<BasicDataArray> Celartem::DataStore::getAsDataArray | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) |
This method gets the Serializable object specified by name as BasicDataArray.
This implementation internally uses dynamic_cast<> to convert Serializable into BasicDataArray.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
AutoPtr<const BasicDataArray> Celartem::DataStore::getAsDataArray | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) | const |
This method gets the Serializable object specified by name as BasicDataArray (const version).
This implementation internally uses dynamic_cast<> to convert Serializable into BasicDataArray.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
AutoPtr<DataStore> Celartem::DataStore::getAsDataStore | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) |
This method gets the Serializable object specified by name as DataStore.
This implementation internally uses dynamic_cast<> to convert Serializable into DataStore.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
AutoPtr<const DataStore> Celartem::DataStore::getAsDataStore | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) | const |
This method gets the Serializable object specified by name as DataStore (const version).
This implementation internally uses dynamic_cast<> to convert Serializable into DataStore.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as double value.
This implementation internally uses dynamic_cast<> to convert Serializable into SerializableData<double> that contains double value.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as Guid.
This implementation internally uses dynamic_cast<> to convert Serializable into SerializableData<Guid>.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as ssize_t value.
Any signed integral type smaller than ssize_t can be obtained by this method.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as int64_t value.
Any signed integral type smaller than int64_t can be obtained by this method.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as String.
This implementation internally uses dynamic_cast<> to convert Serializable into SerializableData<String>.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as Time.
This implementation internally uses dynamic_cast<> to convert Serializable into SerializableData<Time>.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as TimeSpan.
This implementation internally uses dynamic_cast<> to convert Serializable into SerializableData<TimeSpan>.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
This method gets the Serializable object specified by name as size_t value.
Any unsigned integral type smaller than size_t can be obtained by this method.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
uint64_t Celartem::DataStore::getAsUInteger64 | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) | const |
This method gets the Serializable object specified by name as uint64_t value.
Any unsigned integral type smaller than uint64_t can be obtained by this method.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
const Guid& Celartem::DataStore::getClassIdOf | ( | const String & | inName, |
UChar4 | pathSep = '\0' |
||
) | const |
Obtains the class Id (Guid) of the object specified by name.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
Obtains the class name of the object specified by name.
inName | Name or path of the new object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
pure virtual |
This method gets the name of the object instance by index.
inIndex | Index of the object. |
|
pure virtual |
This method returns the number of Serializable instance in this DataStore as direct children.
|
pure virtual |
This method instructs the DataStore not to use Checksum when serializing the contents into the stream.
|
pure virtual |
Add child object instance by the specified name. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
inSerializable | An object to add. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
Referenced by setT().
Add a size_t value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A size_t value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const char * | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a string value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A string. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const utf8s & | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a string value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A string. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const String & | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a string value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A string. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const Time & | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a Time value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A Time value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const TimeSpan & | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a TimeSpan value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A TimeSpan value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
const Guid & | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a Guid value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A Guid value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty | ( | const String & | inName, |
Serializable * | inSerializable, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a Serializable value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
inSerializable | A Serializable value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty_Double | ( | const String & | inName, |
double | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a double value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A double value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
Add an int value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A size_t value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty_I64 | ( | const String & | inName, |
int64_t | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a 64-bit int value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A size_t value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
Add an unsigned int value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A ssize_t value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
void Celartem::DataStore::setProperty_U64 | ( | const String & | inName, |
uint64_t | v, | ||
UChar4 | pathSep = '\0' |
||
) |
Add a 64-bit unsigned int value. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
v | A ssize_t value. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
inline |
Add child object instance by the specified name. This method automatically create the DataStore instance that is needed to add the specified DataStore to creating the directory structure.
inName | Name or path of the new object. |
inValue | An object to add. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |
|
pure virtual |
Removes the object from the DataStore instance. This method does not delete the instance but just unlink from the DataStore.
inName | Name or path of the object. |
pathSep | Path separator used in inName parameter if inName is the path, otherwise it should be '\0'. |