A datatype to store values for a Parameter. More...

#include <shared_type.h>

Collaboration diagram for SharedType:
[legend]

Public Member Functions

bool SetSharedTypeFromString (SharedType *const value_p, const ParameterType pt, const char *value_s)
 Set the current value of a SharedType from a string. More...
 
bool SetSharedTypeFromJSON (SharedType *value_p, const json_t *json_p, const ParameterType pt)
 Set the value for a given SharedType object from a JSON fragment. More...
 
void ClearSharedType (SharedType *st_p, const ParameterType pt)
 Clear the value of a SharedType releasing any allocated memory for the value. More...
 
void InitSharedType (SharedType *st_p)
 Initialise a SharedType ready for use. More...
 
bool CopySharedType (const SharedType src, SharedType *dest_p, const ParameterType pt)
 Make a deep copy of the value of one SharedType to another. More...
 

Data Fields

bool st_boolean_value
 A Boolean value. More...
 
int32 st_long_value
 A signed integer. More...
 
uint32 st_ulong_value
 An unsigned integer. More...
 
double64 st_data_value
 A real number. More...
 
char * st_string_value_s
 A c-style string. More...
 
char st_char_value
 A single character. More...
 
Resourcest_resource_value_p
 A Resource. More...
 
LinkedListst_multiple_values_p
 A LinkedList of multiple values. More...
 
json_t * st_json_p
 A JSON fragment. More...
 
struct tm * st_time_p
 A time and date. More...
 

Detailed Description

A datatype to store values for a Parameter.

Use the ParameterType to access the correct value.

Examples
long_running_service.c.

Member Function Documentation

◆ SetSharedTypeFromString()

bool SetSharedTypeFromString ( SharedType *const  value_p,
const ParameterType  pt,
const char *  value_s 
)

Set the current value of a SharedType from a string.

Parameters
value_pThe Parameter to set the current value for.
ptThe ParameterType for the given SharedType.
value_sThe Parameter value as a string.
Returns
true if the SharedType value was set successfully, false otherwise.

◆ SetSharedTypeFromJSON()

bool SetSharedTypeFromJSON ( SharedType value_p,
const json_t *  json_p,
const ParameterType  pt 
)

Set the value for a given SharedType object from a JSON fragment.

Parameters
value_pThe SharedType object to update.
json_pThe JSON fragment to read the value to update the SharedType object's value from.
ptThe ParameterType of the SharedType object. will be stored.
Returns
true if the SharedType object was updated successfully, false otherwise.

◆ ClearSharedType()

void ClearSharedType ( SharedType st_p,
const ParameterType  pt 
)

Clear the value of a SharedType releasing any allocated memory for the value.

Parameters
st_pThe SharedType to clear.
ptThe ParameterType for this SharedType

◆ InitSharedType()

void InitSharedType ( SharedType st_p)

Initialise a SharedType ready for use.

Parameters
st_pThe SharedType to initialise.
Examples
long_running_service.c.

◆ CopySharedType()

bool CopySharedType ( const SharedType  src,
SharedType dest_p,
const ParameterType  pt 
)

Make a deep copy of the value of one SharedType to another.

Parameters
srcThe SharedType to copy the value from.
dest_pThe SharedType to copy the value to.
ptThe ParameterType for this SharedType
Returns
true if the value was copied successfully, false otherwise.

Field Documentation

◆ st_boolean_value

bool st_boolean_value

A Boolean value.

◆ st_long_value

int32 st_long_value

A signed integer.

◆ st_ulong_value

uint32 st_ulong_value

An unsigned integer.

Examples
long_running_service.c.

◆ st_data_value

double64 st_data_value

A real number.

◆ st_string_value_s

char* st_string_value_s

A c-style string.

◆ st_char_value

char st_char_value

A single character.

◆ st_resource_value_p

Resource* st_resource_value_p

◆ st_multiple_values_p

LinkedList* st_multiple_values_p

A LinkedList of multiple values.

◆ st_json_p

json_t* st_json_p

A JSON fragment.

◆ st_time_p

struct tm* st_time_p

A time and date.


The documentation for this union was generated from the following files: