#include <collection.h>
A Collection is a bundle of heterogeneous data (a la struct C). Each data in a collection is indexed by a name. Available types of data are:
For the use of Collection see The Collection.
Public Member Functions | |
Typobj | Type () const |
std::string | Name () const |
Pobject * | Clone () const |
Collection & | operator= (const Collection &col) |
void | Erase (const std::string &name) |
void | Delete () |
void | Rename (const std::string &oldname, const std::string &newname) |
bool | Exists (const std::string &name) const |
Errc | NbOf (const std::string &name, std::string &type_out, Long &number_out, Long &minsize_out) const |
std::string | GetType (const std::string &name) const |
std::list< std::string > | List () const |
Errc | LoadAttributes (FILE *) |
Errc | SaveAttributes (FILE *file) const |
Errc | LoadData (FILE *file) |
Errc | SaveData (FILE *file) const |
Pobject * | Mask (const Pobject *) |
Pobject * | UnMask (const Pobject *, const Pobject *) |
void | Set (const std::string &name, BundledObject *bo) |
BundledObject * | Get (const std::string &name) const |
template<typename T> | |
void | SetValue (const std::string &name, const T &val) |
template<typename T> | |
T & | GetValue (const std::string &name, const T *) const |
template<typename T> | |
void | SetArray (const std::string &name, T *val, Long size) |
template<typename T> | |
T * | GetArray (const std::string &name, const T *) const |
template<typename T> | |
Long | GetArraySize (const std::string &name, const T *) const |
template<typename T> | |
void | SetPobject (const std::string &name, T *val) |
template<typename T> | |
T * | GetPobject (const std::string &name, const T *) const |
template<typename T> | |
void | SetPArray (const std::string &name, T *val, Long size) |
template<typename T> | |
T ** | GetPArray (const std::string &name, const T *) const |
template<typename T> | |
Long | GetPArraySize (const std::string &name, const T *) const |
template<typename T> | |
T ** | GetNArrays (const std::string &name, Long n, Long &min_out, const T *) const |
|
Creates and returns a distinct copy of this object.
|
|
Deletes all data in the collection. Bug: map cannot be desallocated item by item with erase(i). So, we use clear(). |
|
Erases the specified data from the collection.
|
|
Checks if the specified data exist in the collection. e.g.: if (col.Exists("foo")) ...
|
|
Returns the data with the specified name from the collection.
|
|
Returns the array of data with the specified name from the collection.
|
|
Returns the size of the array of data with the specified name in the collection.
|
|
Returns the list of primitive type arrays with the specified prefix name in the collection. For a given name "foo", each array is named : foo.0, foo.1, ...
|
|
Returns the array of Pandore objects with the specified name from the collection.
|
|
Returns the size of the Pandore object array with the specified name in the collection.
|
|
Returns the Pandore object with the specified name from the collection.
|
|
Returns the type of the data specified by its name.
|
|
Gets the given primitive data with the specified name in the collection. Available primitive types are Uchar, Char, Slong, Float...
|
|
Returns the list of all data names in the collection.
|
|
Loads attribute values from the specified file. Allocates therefrom the related data.
|
|
Loads data from the specified file.
|
|
Creates a new collection with the same type but where the data are masked by the given mask. It means that values are set to 0 when the related label in the mask is 0. Not implemented.
|
|
Returns the type name of the type collection (for instance "Collection").
|
|
Returns the number of arrays in a collection of arrays. Each array is named, foo.1, foo.2, ..., if foo is the name of arrays.
|
|
Sets the Collection with the specified collection values. Deletes old values if necessary.
|
|
Renames the specified data with the specified name. e.g.: col.Rename("foo", "bar");
|
|
Saves the current attribute values in the specified file.
|
|
Saves data in the specified file.
|
|
Sets the given data with the specified name in the collection.
|
|
Sets the given array of primitive data with the specified name in the collection. Available primitive type are Uchar, Char, Short, Float...
|
|
Sets the given array of Pandore objects with the specified name in the collection. Available Pandore object are any Pobject.
|
|
Sets the given Pandore object with the specified name in the collection. Available Pandore object is any Pobject.
|
|
Sets the given primitive data with the specified name in the collection. Available primitive types are Uchar, Char, Short, Float...
|
|
Returns the identifier of the type Collection (for instance Po_Collection).
|
|
Creates a new collection with the same type but where the data are ummasked by the given mask and the given reference image. It means that values are set to the value of the reference object when the related label in the mask is 0. Not implemented.
|