ESR_SessionType Struct Reference
[ESR_SessionType API functions]


Detailed Description

Hashmap with helper functions for adding primitives and add-if-empty.

Data Fields

ESR_ReturnCode(* getProperty )(struct ESR_SessionType_t *self, const LCHAR *name, void **value, VariableTypes type)
ESR_ReturnCode(* getPropertyType )(struct ESR_SessionType_t *self, const LCHAR *name, VariableTypes *type)
ESR_ReturnCode(* getInt )(struct ESR_SessionType_t *self, const LCHAR *name, int *value)
ESR_ReturnCode(* getUint16_t )(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t *value)
ESR_ReturnCode(* getSize_t )(struct ESR_SessionType_t *self, const LCHAR *name, size_t *value)
ESR_ReturnCode(* getFloat )(struct ESR_SessionType_t *self, const LCHAR *name, float *value)
ESR_ReturnCode(* getBool )(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL *value)
ESR_ReturnCode(* getLCHAR )(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value, size_t *len)
ESR_ReturnCode(* contains )(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL *exists)
ESR_ReturnCode(* setProperty )(struct ESR_SessionType_t *self, const LCHAR *name, void *value, VariableTypes type)
ESR_ReturnCode(* setInt )(struct ESR_SessionType_t *self, const LCHAR *name, int value)
ESR_ReturnCode(* setUint16_t )(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t value)
ESR_ReturnCode(* setSize_t )(struct ESR_SessionType_t *self, const LCHAR *name, size_t value)
ESR_ReturnCode(* setFloat )(struct ESR_SessionType_t *self, const LCHAR *name, float value)
ESR_ReturnCode(* setBool )(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL value)
ESR_ReturnCode(* setLCHAR )(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value)
ESR_ReturnCode(* setIntIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, int value)
ESR_ReturnCode(* setUint16_tIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t value)
ESR_ReturnCode(* setSize_tIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, size_t value)
ESR_ReturnCode(* setFloatIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, float value)
ESR_ReturnCode(* setBoolIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL value)
ESR_ReturnCode(* setLCHARIfEmpty )(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value)
ESR_ReturnCode(* removeProperty )(struct ESR_SessionType_t *self, const LCHAR *name)
ESR_ReturnCode(* removeAndFreeProperty )(struct ESR_SessionType_t *self, const LCHAR *name)
ESR_ReturnCode(* importCommandLine )(struct ESR_SessionType_t *self, int argc, char *argv[])
ESR_ReturnCode(* getSize )(struct ESR_SessionType_t *self, size_t *size)
ESR_ReturnCode(* getKeyAtIndex )(struct ESR_SessionType_t *self, size_t index, LCHAR **key)
ESR_ReturnCode(* convertToInt )(struct ESR_SessionType_t *self, const LCHAR *key)
ESR_ReturnCode(* convertToUint16_t )(struct ESR_SessionType_t *self, const LCHAR *key)
ESR_ReturnCode(* convertToSize_t )(struct ESR_SessionType_t *self, const LCHAR *key)
ESR_ReturnCode(* convertToFloat )(struct ESR_SessionType_t *self, const LCHAR *key)
ESR_ReturnCode(* convertToBool )(struct ESR_SessionType_t *self, const LCHAR *key)
ESR_ReturnCode(* destroy )(struct ESR_SessionType_t *self)
ESR_ReturnCode(* importParFile )(struct ESR_SessionType_t *self, const LCHAR *filename)
ESR_ReturnCode(* importArgFile )(struct ESR_SessionType_t *self, const LCHAR *filename)
ESR_ReturnCode(* addListener )(struct ESR_SessionType_t *self, ESR_SessionTypeListenerPair *listener)
ESR_ReturnCode(* removeListener )(struct ESR_SessionType_t *self, ESR_SessionTypeListenerPair *listener)
void * data

Field Documentation

ESR_ReturnCode(* ESR_SessionType::getProperty)(struct ESR_SessionType_t *self, const LCHAR *name, void **value, VariableTypes type)

Returns session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
type Expected variable type (for strong-typing purposes)
Returns:
ESR_INVALID_RESULT_TYPE if the property is not of the specified type

ESR_ReturnCode(* ESR_SessionType::getPropertyType)(struct ESR_SessionType_t *self, const LCHAR *name, VariableTypes *type)

Returns the type of a property value.

Parameters:
self ESR_SessionType handle
name Property name
type [out] Value type
Returns:
ESR_INVALID_ARGUMENT if self is null or property cannot be found

ESR_ReturnCode(* ESR_SessionType::getInt)(struct ESR_SessionType_t *self, const LCHAR *name, int *value)

Returns copy of session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a int

ESR_ReturnCode(* ESR_SessionType::getUint16_t)(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t *value)

Returns copy of session property value.

Parameters:
name Property name
value Property value
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a asr_uint16_t

ESR_ReturnCode(* ESR_SessionType::getSize_t)(struct ESR_SessionType_t *self, const LCHAR *name, size_t *value)

Returns copy of session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a size_t

ESR_INVALID_RESULT_TYPE if the property is not a size_t

ESR_ReturnCode(* ESR_SessionType::getFloat)(struct ESR_SessionType_t *self, const LCHAR *name, float *value)

Returns copy of session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a float

ESR_ReturnCode(* ESR_SessionType::getBool)(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL *value)

Returns copy of session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a bool

ESR_ReturnCode(* ESR_SessionType::getLCHAR)(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value, size_t *len)

Returns copy of session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
len Size of value argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable.
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*

ESR_ReturnCode(* ESR_SessionType::contains)(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL *exists)

Indicates if key exists in the session.

Parameters:
self ESR_SessionType handle
name Property name
exists True if key exists, false otherwise
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ESR_SessionType::setProperty)(struct ESR_SessionType_t *self, const LCHAR *name, void *value, VariableTypes type)

Sets session property value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
type Type of value being set
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setInt)(struct ESR_SessionType_t *self, const LCHAR *name, int value)

Sets session property value, storing a copy of the value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setUint16_t)(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t value)

Sets session property value, storing a copy of the value.

Parameters:
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setSize_t)(struct ESR_SessionType_t *self, const LCHAR *name, size_t value)

Sets session property value, storing a copy of the value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setFloat)(struct ESR_SessionType_t *self, const LCHAR *name, float value)

Sets session property value, storing a copy of the value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setBool)(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL value)

Sets session property value, storing a copy of the value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setLCHAR)(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value)

Sets session property value, storing a copy of the value.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setIntIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, int value)

If the key does not exist in the session, calls SessionSetInt().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setUint16_tIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, asr_uint16_t value)

If the key does not exist in the session, calls SessionSetUint16_t().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setSize_tIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, size_t value)

If the key does not exist in the session, calls SessionSetSize_t().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setFloatIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, float value)

If the key does not exist in the session, calls SessionSetFloat().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setBoolIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, ESR_BOOL value)

If the key does not exist in the session, calls SessionSetBool().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::setLCHARIfEmpty)(struct ESR_SessionType_t *self, const LCHAR *name, LCHAR *value)

If the key does not exist in the session, calls SessionSetLCHAR().

This helper function aids implementation of "default values", overwriting session values only if they have not been set already.

Parameters:
self ESR_SessionType handle
name Property name
value Property value
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::removeProperty)(struct ESR_SessionType_t *self, const LCHAR *name)

Removes property from session.

Parameters:
self ESR_SessionType handle
name Property name
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_NO_MATCH_ERROR if key cannot be found

ESR_ReturnCode(* ESR_SessionType::removeAndFreeProperty)(struct ESR_SessionType_t *self, const LCHAR *name)

Removes and deallocates property from session.

Parameters:
self ESR_SessionType handle
name Property name
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_NO_MATCH_ERROR if key cannot be found

ESR_ReturnCode(* ESR_SessionType::importCommandLine)(struct ESR_SessionType_t *self, int argc, char *argv[])

Imports commandline arguments into the system session.

Keys are imported as "cmdline.[name]" where [name] is the name of the command-line argument Values are set in char* format.

For example, given the argument "-timer=5", the following key will be added to the session: ["cmdline.timer", "5"]

Validation is left up to the application.

If the session contains a key that is clobbered by the parser, the old [key, value] pair will be deallocated. For example, if the session contained ["cmdline.timer", "value"] before the aforementioned example occured, then the old [key, value] pair will be allocated by the parser.

Parameters:
self ESR_SessionType handle
argc Number of arguments
argv Argument values
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if the system is out of memory;

ESR_ReturnCode(* ESR_SessionType::getSize)(struct ESR_SessionType_t *self, size_t *size)

Returns the number of elements in the session.

Parameters:
self ESR_SessionType handle
size [out] Session size
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ESR_SessionType::getKeyAtIndex)(struct ESR_SessionType_t *self, size_t index, LCHAR **key)

Returns the key associated with the specified index.

Parameters:
self ESR_SessionType handle
index Element index
key [out] Key name
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_ARGUMENT_OUT_OF_BOUNDS if index is out of bounds

ESR_ReturnCode(* ESR_SessionType::convertToInt)(struct ESR_SessionType_t *self, const LCHAR *key)

Convert the specified argument to int.

Parameters:
self ESR_SessionType handle
key Property name
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*; ESR_OUT_OF_MEMORY if system is out of memory; ESR_INVALID_ARGUMENT if self is null or property cannot be converted to int

ESR_ReturnCode(* ESR_SessionType::convertToUint16_t)(struct ESR_SessionType_t *self, const LCHAR *key)

Convert the specified argument to asr_uint16_t.

Parameters:
self ESR_SessionType handle
key Property name
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*; ESR_OUT_OF_MEMORY if system is out of memory; ESR_INVALID_ARGUMENT if self is null or property cannot be converted to asr_uint16_t

ESR_ReturnCode(* ESR_SessionType::convertToSize_t)(struct ESR_SessionType_t *self, const LCHAR *key)

Convert the specified argument to size_t.

Parameters:
self ESR_SessionType handle
key Property name
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*; ESR_OUT_OF_MEMORY if system is out of memory; ESR_INVALID_ARGUMENT if self is null or property cannot be converted to size_t

ESR_ReturnCode(* ESR_SessionType::convertToFloat)(struct ESR_SessionType_t *self, const LCHAR *key)

Convert the specified argument to float.

Parameters:
self ESR_SessionType handle
key Property name
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*; ESR_OUT_OF_MEMORY if system is out of memory; ESR_INVALID_ARGUMENT if self is null or property cannot be converted to float

ESR_ReturnCode(* ESR_SessionType::convertToBool)(struct ESR_SessionType_t *self, const LCHAR *key)

Convert the specified argument to bool.

Parameters:
self ESR_SessionType handle
key Property name
Returns:
ESR_INVALID_RESULT_TYPE if the property is not a LCHAR*; ESR_OUT_OF_MEMORY if system is out of memory; ESR_INVALID_ARGUMENT if self is null or property cannot be converted to bool

ESR_ReturnCode(* ESR_SessionType::destroy)(struct ESR_SessionType_t *self)

Destroys the Session.

Parameters:
self ESR_SessionType handle
Returns:
ESR_INVALID_ARGUMENT if self is null

ESR_ReturnCode(* ESR_SessionType::importParFile)(struct ESR_SessionType_t *self, const LCHAR *filename)

Import PAR file into session.

Parameters:
self ESR_SessionType handle
file File to read session from
Returns:
ESR_INVALID_STATE if self is null; ESR_OPEN_ERROR if file cannot be opened; ESR_READ_ERROR if file cannot be read; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::importArgFile)(struct ESR_SessionType_t *self, const LCHAR *filename)

Import ARG file into session.

Parameters:
self ESR_SessionType handle
file File to read arguments from

ESR_ReturnCode(* ESR_SessionType::addListener)(struct ESR_SessionType_t *self, ESR_SessionTypeListenerPair *listener)

Adds an event-listener.

Parameters:
self ESR_SessionType handle
listener The event-listener to add
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

ESR_ReturnCode(* ESR_SessionType::removeListener)(struct ESR_SessionType_t *self, ESR_SessionTypeListenerPair *listener)

Removes an event-listener.

Parameters:
self ESR_SessionType handle
listener The event-listener to remove
Returns:
ESR_INVALID_ARGUMENT if self is null; ESR_OUT_OF_MEMORY if system is out of memory

void* ESR_SessionType::data

Pointer to session data.


Generated on Thu May 1 15:37:27 2008 for SREC by  doxygen 1.5.3