#include <MamaFieldCache.h>
Name | |
---|---|
class | const_iterator |
class | iterator |
class | MamaFieldCacheIterator |
Name | |
---|---|
MamaFieldCache() | |
virtual | ~MamaFieldCache() |
virtual void | create() |
virtual void | clear() |
virtual mama_size_t | getSize() const |
virtual void | setTrackModified(bool value) |
virtual bool | getTrackModified() const |
virtual void | setUseFieldNames(bool value) |
virtual bool | getUseFieldNames() const |
virtual void | setUseLock(bool value) |
virtual bool | getUseLock() const |
virtual void | lock() |
virtual void | unlock() |
virtual const MamaFieldCacheField * | find(mama_fid_t fid, const char * name =NULL) const |
virtual MamaFieldCacheField * | find(mama_fid_t fid, const char * name =NULL) |
virtual void | setModified(MamaFieldCacheField & field) |
virtual void | apply(const MamaFieldCacheField & field) |
virtual void | apply(const MamaMsg & msg, const MamaDictionary * dict =NULL) |
virtual void | apply(const MamaFieldCacheRecord & record) |
virtual void | getFullMessage(MamaMsg & msg) |
virtual void | getDeltaMessage(MamaMsg & msg) |
virtual void | clearModifiedFields() |
virtual const_iterator | begin() const |
virtual iterator | begin() |
virtual const_iterator | end() const |
virtual iterator | end() |
class Wombat::MamaFieldCache;
The [MamaFieldCache](classWombat_1_1MamaFieldCache.html)
class is a collection of unordered [MamaFieldCacheField](classWombat_1_1MamaFieldCacheField.html)
elements. This class provides methods for creating and finding fields, applying changes to the fields in the cache and populating a MamaMsg with the fields in cache.
MamaFieldCache()
Constructor. Use create
to create the actual cache.
virtual ~MamaFieldCache()
Destructor. This is called automatically when an object is destroyed. This method will clean all the memory allocated.
virtual void create()
Create a MamaFieldCache.
virtual void clear()
Clear the [MamaFieldCache](classWombat_1_1MamaFieldCache.html)
. No fields will be present in the cache after this operation. The cache is ready to be used, as long as create has been called once.
virtual mama_size_t getSize() const
Return: The number of fields in cache.
Return the number of fields in cache.
virtual void setTrackModified(
bool value
)
Parameters:
Set if field modifications are tracked when creating a delta message. See method getDeltaMessage
. When modifications are not tracked, then calling getDeltaMessage
is the same as calling getFullMessage
.
virtual bool getTrackModified() const
Return: Whether tracking modifications is enabled or not.
Return the value of the track modifications flag.
virtual void setUseFieldNames(
bool value
)
Parameters:
Set if field names are used when adding fields to MamaMsg. See methods getDeltaMessage
and getFullMessage
.
virtual bool getUseFieldNames() const
Return: Whether field names are enabled or not.
Return the value of the use field names flag.
virtual void setUseLock(
bool value
)
Parameters:
Set if the cache uses a lock when some methods are called for thread safety.
virtual bool getUseLock() const
Return: Whether the cache is using a lock or not.
Return the value of the locking flag.
virtual void lock()
Lock the cache.
virtual void unlock()
Unlock the cache.
virtual const MamaFieldCacheField * find(
mama_fid_t fid,
const char * name =NULL
) const
Parameters:
Return: The field in the cache (if present)
Retrieve a field from the cache. Note that the field returned is a pointer to a reusable MamaFieldCacheField field for the MamaFieldCache which will be overwritten each time the function is called. If the field is not found then NULL is returned.
virtual MamaFieldCacheField * find(
mama_fid_t fid,
const char * name =NULL
)
Parameters:
Return: The field in the cache (if present)
Retrieve a field from the cache. Note that the field returned is a pointer to a reusable MamaFieldCacheField field for the MamaFieldCache which will be overwritten each time the function is called. If the field is not found then NULL is returned.
virtual void setModified(
MamaFieldCacheField & field
)
Parameters:
Set the specified field as modified even if the value has not changed.
virtual void apply(
const MamaFieldCacheField & field
)
Parameters:
Update the cache content with the field given. If the field is already present, it will be updated, otherwise it will be added to the cache.
virtual void apply(
const MamaMsg & msg,
const MamaDictionary * dict =NULL
)
Parameters:
[MamaMsg](classWombat_1_1MamaMsg.html)
containing the fields to update in the cache.[MamaDictionary](classWombat_1_1MamaDictionary.html)
representing a data dictionary.Update the cache content with the data contained in the message.
virtual void apply(
const MamaFieldCacheRecord & record
)
Parameters:
[MamaFieldCacheRecord](classWombat_1_1MamaFieldCacheRecord.html)
containing the fields to update in the cache.Update the cache content with the data contained in the record.
virtual void getFullMessage(
MamaMsg & msg
)
Parameters:
Populate a MamaMsg with all the fields present in the cache.
virtual void getDeltaMessage(
MamaMsg & msg
)
Parameters:
Populate a MamaMsg with all the fields currently modified in the cache. Note that this method also resets the modification state of the modified fields. If trackModifications flag is set to false, then this method is the same as getFullMessage
.
virtual void clearModifiedFields()
Clear the list of all the modified fields and reset the modified flags for all the modified fields in the cache.
virtual const_iterator begin() const
Return: An iterator to the first element in the cache.
Return a constant iterator to the first field in the cache and allows to iterate over the fields in the cache.
virtual iterator begin()
Return: An iterator to the first element in the cache.
Return an iterator to the first field in the cache and allows to iterate over the fields in the cache.
virtual const_iterator end() const
Return: An iterator to the first element in the cache.
Return a const iterator to an invalid element and allows to check if an iterator has arrived to the end (no more elements to iterate). The content of this iterator must not be accessed.
virtual iterator end()
Return: An iterator to the first element in the cache.
Return an iterator to an invalid element and allows to check if an iterator has arrived to the end (no more elements to iterate). The content of this iterator must not be accessed.
Updated on 2023-03-31 at 15:29:24 +0100