Classes Files

com::wombat::mama::MamaFieldCacheProperties

More…

Public Functions

  Name
  MamaFieldCacheProperties(int hashSize)
  MamaFieldCacheProperties()
  MamaFieldCacheProperties(MamaFieldCacheProperties source)
void clear()
void clearAndDelete()
void add(MamaFieldCacheField field)
void addIfModified(MamaFieldCacheField field)
void clearAndUnregisterAll()
void registerProperty(int fid, MamaFieldCacheField field)
boolean apply(MamaMsgField value)
MamaFieldCacheField find(String name)
MamaFieldCacheField find(int fid)
MamaFieldCacheField find(MamaFieldDescriptor desc)
int size()
boolean empty()
Iterator getIterator()
void registerProperties(int[] fids, MamaDictionary theDictionary)
void apply(MamaFieldCacheFieldList fields)
void dump()
void dump(OutputStream outputStream)

Detailed Description

class com::wombat::mama::MamaFieldCacheProperties;

The MamaFieldCacheProperties class is used for MamdaOrderBookProperties.

This class maintains a collection of MamaFieldCacheField objects mapped to fids. A field will only be added to or updated in the cache if its fid matches a fid previously registed with the registerField method.

Public Functions Documentation

function MamaFieldCacheProperties

inline MamaFieldCacheProperties(
    int hashSize
)

function MamaFieldCacheProperties

inline MamaFieldCacheProperties()

function MamaFieldCacheProperties

inline MamaFieldCacheProperties(
    MamaFieldCacheProperties source
)

function clear

inline void clear()

This method clears the fields but does not unregister the properteis.

function clearAndDelete

inline void clearAndDelete()

function add

inline void add(
    MamaFieldCacheField field
)

Parameters:

  • field The field to add.

Add a field to the cache. If it is not already a property it will be added with its fid.

function addIfModified

inline void addIfModified(
    MamaFieldCacheField field
)

Parameters:

  • field The field to add.

Add a field to the cache. If it is not already a property it will be added with its fid. The field only gets added if the supplied field is modified.

function clearAndUnregisterAll

inline void clearAndUnregisterAll()

Clear the cache and unregister all the properties.

function registerProperty

inline void registerProperty(
    int fid,
    MamaFieldCacheField field
)

Parameters:

  • fid The fid
  • field The field.

Adds a property. The MamaFieldCacheField will not appear in iterations until an [apply()](classcom_1_1wombat_1_1mama_1_1MamaFieldCacheProperties.html#function-apply) for that field occurs.

function apply

inline boolean apply(
    MamaMsgField value
)

Parameters:

  • value The new value

Return: true if a the field was found and updated.

Apply the field to the cache. If the field does not exist as a property the cache does not change.

function find

inline MamaFieldCacheField find(
    String name
)

Parameters:

  • name The field name.

Return: The field or null.

Find a field by name. This is less efficient than find by Fid or field descriptor.

function find

inline MamaFieldCacheField find(
    int fid
)

Parameters:

  • fid The fid

Return: the field or null.

Find a field by fid.

function find

inline MamaFieldCacheField find(
    MamaFieldDescriptor desc
)

Parameters:

  • desc The descriptor.

Return: the field or null.

Find by field descriptor. This method uses the fid from the descriptor.

function size

inline int size()

Return: the size.

Return the number of properties in the cache.

function empty

inline boolean empty()

Return: true if the cache contains no properties.

Return true if the cache is empty.

function getIterator

inline Iterator getIterator()

Return: the iterator.

Returns an iterator that only iterates over the properties that have had values applied.

function registerProperties

inline void registerProperties(
    int[] fids,
    MamaDictionary theDictionary
)

function apply

inline void apply(
    MamaFieldCacheFieldList fields
)

Parameters:

  • fields The fields to apply.

Apply all the fields in the supplied list for which there are properties.

function dump

inline void dump()

Dump the order book to standard out.

function dump

inline void dump(
    OutputStream outputStream
)

Parameters:

  • outputStream the OutputStream

Dump the properties to an OutputStream.


Updated on 2023-03-31 at 15:29:42 +0100