IUF-SDK-3
Interventional Ultrasound Library
iufSourceDict.c File Reference
#include <stdlib.h>
#include <string.h>
#include <hashmap.h>
#include <iuf.h>
#include <iufSourcePrivate.h>

Data Structures

struct  HashableSource
 
struct  IufSourceDict
 

Macros

#define MAX_NAME   1024
 

Functions

iusd_t iufSourceDictCreate ()
 Create an empty dictionary. More...
 
int iufSourceDictDeepDelete (iusd_t dict)
 Deletes a source dictionary and all its sources. More...
 
int iufSourceDictDelete (iusd_t dict)
 Deletes a source dictionary without deleting all the sources. More...
 
int iufSourceDictCompare (iusd_t reference, iusd_t actual)
 Compare two dictionaries with each other (order of arguments doesn't matter) More...
 
int iufSourceDictGetSize (iusd_t dict)
 Get the number of sources in the dictionary. More...
 
ius_t iufSourceDictGet (iusd_t dict, char *key)
 Get a sources from the dictionary. More...
 
char ** iufSourceDictGetKeys (iusd_t dict)
 Get the keys currently available in the dict. More...
 
int iufSourceDictSet (iusd_t dict, char *key, ius_t member)
 Add a sources to the dictionary. More...
 
int iufSourceDictSave (iusd_t dict, hid_t handle)
 
iusd_t iufSourceDictLoad (hid_t handle)
 

Data Structure Documentation

◆ HashableSource

struct HashableSource
Data Fields
char key[256]
ius_t source

◆ IufSourceDict

struct IufSourceDict
Data Fields
IUF_BOOL deepDelete
char ** keys
struct hashmap map

Macro Definition Documentation

◆ MAX_NAME

#define MAX_NAME   1024

Function Documentation

◆ iufSourceDictCompare()

int iufSourceDictCompare ( iusd_t  reference,
iusd_t  actual 
)

Compare two dictionaries with each other (order of arguments doesn't matter)

Returns
Returns IUF_TRUE when the dictionaries are equal and IUF_FALSE otherwise.
Parameters
referenceThe source dictionary to compare to
actualThe source dictionary to compare with

◆ iufSourceDictCreate()

iusd_t iufSourceDictCreate ( void  )

Create an empty dictionary.

Returns
Returns the created dictionary or NULL in case of an error.

◆ iufSourceDictDeepDelete()

int iufSourceDictDeepDelete ( iusd_t  dict)

Deletes a source dictionary and all its sources.

Returns
Returns IUF_E_OK in case of success and IUF_ERR_VALUE in case of an error.
Parameters
dictThe dictionary of interest

◆ iufSourceDictDelete()

int iufSourceDictDelete ( iusd_t  dict)

Deletes a source dictionary without deleting all the sources.

Returns
Returns IUF_E_OK in case of success and IUF_ERR_VALUE in case of an invalid argument.
Parameters
dictThe dictionary of interest

◆ iufSourceDictGet()

ius_t iufSourceDictGet ( iusd_t  dict,
char *  key 
)

Get a sources from the dictionary.

Returns
returns the source that has label key or IUF_INVALID if it could not be found
Parameters
dictThe dictionary of interest
keyThe label of the source

◆ iufSourceDictGetKeys()

char** iufSourceDictGetKeys ( iusd_t  dict)

Get the keys currently available in the dict.

Returns
array (with size iufTransmitApodizationDictGetSize) of keys.
Parameters
dictThe dictionary of interest

◆ iufSourceDictGetSize()

int iufSourceDictGetSize ( iusd_t  dict)

Get the number of sources in the dictionary.

Returns
returns the number of sources or -1 in case of an error
Parameters
dictThe dictionary of interest

◆ iufSourceDictLoad()

iusd_t iufSourceDictLoad ( hid_t  handle)

◆ iufSourceDictSave()

int iufSourceDictSave ( iusd_t  dict,
hid_t  handle 
)

◆ iufSourceDictSet()

int iufSourceDictSet ( iusd_t  dict,
char *  key,
ius_t  member 
)

Add a sources to the dictionary.

Returns
Returns IUF_E_OK in case of success and IUF_ERR_VALUE in case of invalid arguments
Parameters
dictTHe dictionary of interest
keyThe label of the source that is added
memberThe source that is added