33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/ofstd/ofthread.h"
36 #include "dcmtk/dcmdata/dchashdi.h"
39 #define DCM_MAXDICTLINESIZE 2048
42 #define DCM_MAXDICTFIELDS 6
45 #define DCM_DICT_ENVIRONMENT_VARIABLE "DCMDICTPATH"
47 #ifndef DCM_DICT_DEFAULT_PATH
52 #error "DCM_DICT_DEFAULT_PATH is not defined via osconfig.h"
55 #ifndef ENVIRONMENT_PATH_SEPARATOR
56 #define ENVIRONMENT_PATH_SEPARATOR '\n'
118 OFBool
loadDictionary(
const char* fileName, OFBool errorIfAbsent = OFTrue);
encapsulates a data dictionary with access methods which allow safe read and write access from multip...
class maintaining a attribute tag (group and element number)
OFBool loadDictionary(const char *fileName, OFBool errorIfAbsent=OFTrue)
load a particular dictionary from file.
OFBool dictionaryLoaded
is a dictionary loaded (more than skeleton)
iterator class for traversing a DcmHashDict
an ordered list of pointers to DcmDictEntry objects
this class implements a loadable DICOM Data Dictionary
DcmDataDictionary dataDict
the data dictionary managed by this class
each object of this class manages one entry of the global DICOM data dictionary.
GlobalDcmDataDictionary(OFBool loadBuiltin, OFBool loadExternal)
constructor.
GlobalDcmDataDictionary & operator=(const GlobalDcmDataDictionary &)
private undefined assignment operator
const DcmDataDictionary & rdlock()
acquires a read lock and returns a const reference to the dictionary.
int skeletonCount
the number of skeleton entries
const DcmDictEntry * findEntry(const DcmTagKey &key, const char *privCreator) const
dictionary lookup for the given tag key and private creator name.
int numberOfRepeatingTagEntries() const
returns the number of repeating tag entries
void deleteEntry(const DcmDictEntry &entry)
deletes the given entry from either dictionary
~DcmDataDictionary()
destructor
a hash table of pointers to DcmDictEntry objects
DcmHashDictIterator end() const
returns iterator to end of hash table
OFBool isDictionaryLoaded() const
checks if a data dictionary is loaded (excluding the skeleton dictionary)
int size() const
counts total number of entries
void unlock()
unlocks the read or write lock which must have been acquired previously.
void addEntry(DcmDictEntry *entry)
adds an entry to the dictionary.
OFBool loadSkeletonDictionary()
loads the skeleton dictionary (the bare minimum needed to run)
int numberOfEntries() const
returns the number of dictionary entries that were loaded either from file or from a built-in diction...
DcmHashDictIterator begin() const
returns iterator to start of hash table
iterator class for traversing a DcmDictEntryList
DcmHashDictIterator normalBegin()
returns an iterator to the start of the normal (non-repeating) dictionary
DcmHashDictIterator normalEnd()
returns an iterator to the end of the normal (non-repeating) dictionary
void clear()
deletes all dictionary entries
DcmDataDictionary & operator=(const DcmDataDictionary &)
private undefined assignment operator
DcmHashDict hashDict
dictionary of normal tags
OFBool reloadDictionaries(OFBool loadBuiltin, OFBool loadExternal)
reload data dictionaries.
OFBool loadExternalDictionaries()
loads external dictionaries defined via environment variables
OFBool isDictionaryLoaded()
checks if a data dictionary has been loaded.
DcmDataDictionary & wrlock()
acquires a write lock and returns a non-const reference to the dictionary.
void clear()
erases the contents of the dictionary.
DcmDictEntryList repDict
dictionary of repeating tags
DcmDictEntryListIterator repeatingEnd()
returns an iterator to the end of the repeating tag dictionary
OFIterator< T > begin() const
returns an iterator referencing the first element in the list.
size_t size() const
returns number of elements in the list.
void loadBuiltinDictionary()
loads a builtin (compiled) data dictionary.
int numberOfSkeletonEntries() const
returns the number of skeleton entries.
provides an operating system independent abstraction for read/write locks.
OFIterator< T > end() const
returns an iterator which points to the past-to-end element of the list.
int numberOfNormalTagEntries() const
returns the number of normal (non-repeating) tag entries
DcmDataDictionary(OFBool loadBuiltin, OFBool loadExternal)
constructor
DcmDictEntryListIterator repeatingBegin()
returns an iterator to the start of the repeating tag dictionary
~GlobalDcmDataDictionary()
destructor