RAVE
|
Used for managing attributes and handle different versions. More...
#include "rave_attribute_table.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include <string.h>
#include <math.h>
#include <stdio.h>
Classes | |
struct | _RaveAttributeTable_t |
Represents one scan in a volume. More... | |
Macros | |
#define | SPEED_OF_LIGHT 299792458 /* m/s */ |
Functions | |
RaveAttribute_t * | RaveAttributeTableInternal_getAttribute (RaveAttributeTable_t *self, const char *attrname) |
int | RaveAttributeTable_setVersion (RaveAttributeTable_t *self, RaveIO_ODIM_Version version) |
Sets the default version to use for the attribute tables. | |
RaveIO_ODIM_Version | RaveAttributeTable_getVersion (RaveAttributeTable_t *self) |
Returns the default version to use for the attribute tables. | |
int | RaveAttributeTable_addAttribute (RaveAttributeTable_t *self, RaveAttribute_t *attr, RaveAttribute_t **translation) |
Adds an attribute to the attribute table. | |
int | RaveAttributeTable_addAttributeVersion (RaveAttributeTable_t *self, RaveAttribute_t *attr, RaveIO_ODIM_Version version, RaveAttribute_t **translation) |
Adds an attribute to the attribute table. | |
RaveAttribute_t * | RaveAttributeTable_getAttribute (RaveAttributeTable_t *self, const char *attrname) |
Returns an attribute from the attribute table according to default version. | |
RaveAttribute_t * | RaveAttributeTable_getAttributeVersion (RaveAttributeTable_t *self, const char *attrname, RaveIO_ODIM_Version version) |
Returns an attribute from the attribute table according to specified version. | |
int | RaveAttributeTable_size (RaveAttributeTable_t *self) |
Returns the number of items in this table. | |
int | RaveAttributeTable_hasAttribute (RaveAttributeTable_t *self, const char *key) |
Returns if the specified key exists or not. | |
RaveAttribute_t * | RaveAttributeTable_removeAttribute (RaveAttributeTable_t *self, const char *key) |
Removes the item with the specified key and returns it. | |
void | RaveAttributeTable_clear (RaveAttributeTable_t *self) |
Clears all entries in the table. | |
RaveList_t * | RaveAttributeTable_getAttributeNames (RaveAttributeTable_t *self) |
Returns the keys for the table at the current state. | |
RaveList_t * | RaveAttributeTable_getAttributeNamesVersion (RaveAttributeTable_t *self, RaveIO_ODIM_Version version) |
Returns the keys for the table at the current state. | |
RaveObjectList_t * | RaveAttributeTable_getValues (RaveAttributeTable_t *self) |
Returns the values for the table. | |
RaveObjectList_t * | RaveAttributeTable_getValuesVersion (RaveAttributeTable_t *self, RaveIO_ODIM_Version version) |
Returns the values for the table. | |
RaveObjectList_t * | RaveAttributeTable_getInternalValues (RaveAttributeTable_t *self) |
Returns the internal values for the table. | |
int | RaveAttributeTable_shiftAttribute (RaveAttributeTable_t *self, const char *name, int nx) |
Performs a circular shift of an array attribute. | |
int | RaveAttributeTable_shiftAttributeIfExists (RaveAttributeTable_t *self, const char *name, int nx) |
Performs a circular shift of an array attribute if it exists. | |
void | RaveAttributeTable_destroyKeyList (RaveList_t *l) |
Helper function to destroy the returned list of keys. | |
Variables | |
RaveCoreObjectType | RaveAttributeTable_TYPE |
Type definition to use when creating a rave object. | |
Used for managing attributes and handle different versions.
This object supports RAVE_OBJECT_CLONE.
int RaveAttributeTable_addAttribute | ( | RaveAttributeTable_t * | self, |
RaveAttribute_t * | attr, | ||
RaveAttribute_t ** | translation ) |
Adds an attribute to the attribute table.
[in] | self | - self |
[in] | attr | - the attribute |
[in,out] | translation | - if provided and attribute was translated somehow this attribute will be set. Remember to release. |
int RaveAttributeTable_addAttributeVersion | ( | RaveAttributeTable_t * | self, |
RaveAttribute_t * | attr, | ||
RaveIO_ODIM_Version | version, | ||
RaveAttribute_t ** | translation ) |
Adds an attribute to the attribute table.
[in] | self | - self |
[in] | attr | - the attribute |
[in] | version | - the version of the attribute set |
[in,out] | translation | - if provided and attribute was translated somehow this attribute will be set. Remember to release. |
void RaveAttributeTable_clear | ( | RaveAttributeTable_t * | self | ) |
Clears all entries in the table.
[in] | self | - the self |
void RaveAttributeTable_destroyKeyList | ( | RaveList_t * | l | ) |
Helper function to destroy the returned list of keys.
[in] | l | - the list to destroy |
RaveAttribute_t * RaveAttributeTable_getAttribute | ( | RaveAttributeTable_t * | self, |
const char * | attrname ) |
Returns an attribute from the attribute table according to default version.
[in] | self | - self |
[in] | attrname | - the attribute name |
RaveList_t * RaveAttributeTable_getAttributeNames | ( | RaveAttributeTable_t * | self | ) |
Returns the keys for the table at the current state.
Note, remember to deallocate keys appropriately after retrival or use the function @ref RaveList_freeAndDestroy that will take care of it for you.
[in] | self | - self |
RaveList_t * RaveAttributeTable_getAttributeNamesVersion | ( | RaveAttributeTable_t * | self, |
RaveIO_ODIM_Version | version ) |
Returns the keys for the table at the current state.
Note, remember to deallocate keys appropriately after retrival or use the function @ref RaveList_freeAndDestroy that will take care of it for you.
[in] | self | - self |
[in] | version | - the version of the attribute names to return |
RaveAttribute_t * RaveAttributeTable_getAttributeVersion | ( | RaveAttributeTable_t * | self, |
const char * | attrname, | ||
RaveIO_ODIM_Version | version ) |
Returns an attribute from the attribute table according to specified version.
[in] | self | - self |
[in] | attrname | - the attribute name |
[in] | version | - the version of the attribute to return |
RaveObjectList_t * RaveAttributeTable_getInternalValues | ( | RaveAttributeTable_t * | self | ) |
Returns the internal values for the table.
Note, it is not cloned values but references to them.
[in] | self | - self |
RaveObjectList_t * RaveAttributeTable_getValues | ( | RaveAttributeTable_t * | self | ) |
Returns the values for the table.
Note, it is cloned values but references to them.
[in] | self | - self |
RaveObjectList_t * RaveAttributeTable_getValuesVersion | ( | RaveAttributeTable_t * | self, |
RaveIO_ODIM_Version | version ) |
Returns the values for the table.
Note, it is cloned values but references to them.
[in] | self | - self |
[in] | version | - the version of the attribute names to return |
RaveIO_ODIM_Version RaveAttributeTable_getVersion | ( | RaveAttributeTable_t * | self | ) |
Returns the default version to use for the attribute tables.
Note, this does not affect the internally stored attributes. They will always be latest version regardless. This affects the attribute version when using the add & get without specifying version.
[in] | self | - self |
int RaveAttributeTable_hasAttribute | ( | RaveAttributeTable_t * | self, |
const char * | key ) |
Returns if the specified key exists or not.
[in] | table | - self |
[in] | key | - the key to search for |
RaveAttribute_t * RaveAttributeTable_removeAttribute | ( | RaveAttributeTable_t * | self, |
const char * | key ) |
Removes the item with the specified key and returns it.
[in] | self | - the self |
[in] | key | - the key |
int RaveAttributeTable_setVersion | ( | RaveAttributeTable_t * | self, |
RaveIO_ODIM_Version | version ) |
Sets the default version to use for the attribute tables.
Note, this does not affect the internally stored attributes. They will always be latest version regardless. This affects the attribute version when using the add & get without specifying version.
[in] | self | - self |
[in] | version | - the version |
int RaveAttributeTable_shiftAttribute | ( | RaveAttributeTable_t * | self, |
const char * | name, | ||
int | nx ) |
Performs a circular shift of an array attribute.
if nx < 0, then shift is performed counter clockwise, if nx > 0, shift is performed clock wise, if 0, no shift is performed.
[in] | self | - self |
[in] | name | - attribute to shift |
[in] | nx | - number of positions to shift return 1 if successful, 0 if trying to shift an attribute that isn't an array or an error occurs during shift. |
int RaveAttributeTable_shiftAttributeIfExists | ( | RaveAttributeTable_t * | self, |
const char * | name, | ||
int | nx ) |
Performs a circular shift of an array attribute if it exists.
if nx < 0, then shift is performed counter clockwise, if nx > 0, shift is performed clock wise, if 0, no shift is performed.
[in] | self | - self |
[in] | name | - attribute to shift |
[in] | nx | - number of positions to shift return 1 if successful, 0 if trying to shift an attribute that isn't an array or an error occurs during shift. |
int RaveAttributeTable_size | ( | RaveAttributeTable_t * | self | ) |
Returns the number of items in this table.
[in] | self | - the self |
RaveCoreObjectType RaveAttributeTable_TYPE |
Type definition to use when creating a rave object.