AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
NTV2Dictionary Class Reference

A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3) More...

#include <ntv2nubaccess.h>

Public Types

typedef std::map< std::string, std::string > Dict
 
typedef Dict::const_iterator DictConstIter
 

Public Member Functions

size_t initializeFrom (const Dict &inDict)
 
Inquiry
size_t size (void) const
 
bool empty (void) const
 
bool hasKey (const std::string &inKey) const
 
std::string valueForKey (const std::string &inKey) const
 
uint16_t u16ValueForKey (const std::string &inKey, const uint16_t inDefault=0) const
 
NTV2StringSet keys (void) const
 
size_t largestKeySize (void) const
 
size_t largestValueSize (void) const
 
std::ostream & Print (std::ostream &oss, const bool inCompact=true) const
 Prints human-readable representation to ostream. More...
 
bool serialize (std::string &outStr) const
 Serializes my contents into the given string, returns true if string is not empty. More...
 
Changing
void clear (void)
 Removes all of my key/value pairs. More...
 
bool insert (const std::string &inKey, const std::string &inValue)
 Stores the given value using the given key; overwrites existing value if already present. More...
 
size_t erase (const std::string &inKey)
 Erases the given key and its corresponding value from me, returns 1 if successful, 0 if not. More...
 
size_t updateFrom (const NTV2Dictionary &inDict)
 Updates all values from inDict with matching keys, ignoring all non-matching keys. More...
 
size_t addFrom (const NTV2Dictionary &inDict)
 Adds all values from inDict with non-matching keys, ignoring all matching keys. More...
 
bool deserialize (const std::string &inStr)
 Resets me from the given string. More...
 
size_t UpdateFrom (const NTV2Dictionary &inDict)
 
size_t AddFrom (const NTV2Dictionary &inDict)
 

Detailed Description

A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3)

Definition at line 111 of file ntv2nubaccess.h.

Member Typedef Documentation

◆ Dict

typedef std::map<std::string, std::string> NTV2Dictionary::Dict

Definition at line 147 of file ntv2nubaccess.h.

◆ DictConstIter

typedef Dict::const_iterator NTV2Dictionary::DictConstIter

Definition at line 148 of file ntv2nubaccess.h.

Member Function Documentation

◆ addFrom()

size_t NTV2Dictionary::addFrom ( const NTV2Dictionary inDict)

Adds all values from inDict with non-matching keys, ignoring all matching keys.

Definition at line 271 of file ntv2nubaccess.cpp.

◆ AddFrom()

size_t NTV2Dictionary::AddFrom ( const NTV2Dictionary inDict)
inline
Deprecated:
Use addFrom instead.

Definition at line 142 of file ntv2nubaccess.h.

◆ clear()

void NTV2Dictionary::clear ( void  )
inline

Removes all of my key/value pairs.

Definition at line 134 of file ntv2nubaccess.h.

◆ deserialize()

bool NTV2Dictionary::deserialize ( const std::string &  inStr)

Resets me from the given string.

Definition at line 183 of file ntv2nubaccess.cpp.

◆ empty()

bool NTV2Dictionary::empty ( void  ) const
inline
Returns
True if I'm empty

Definition at line 119 of file ntv2nubaccess.h.

◆ erase()

size_t NTV2Dictionary::erase ( const std::string &  inKey)
inline

Erases the given key and its corresponding value from me, returns 1 if successful, 0 if not.

Definition at line 136 of file ntv2nubaccess.h.

◆ hasKey()

bool NTV2Dictionary::hasKey ( const std::string &  inKey) const
inline
Returns
True if I'm storing a value for the given key

Definition at line 120 of file ntv2nubaccess.h.

◆ initializeFrom()

size_t NTV2Dictionary::initializeFrom ( const Dict inDict)
inline

Definition at line 149 of file ntv2nubaccess.h.

◆ insert()

bool NTV2Dictionary::insert ( const std::string &  inKey,
const std::string &  inValue 
)

Stores the given value using the given key; overwrites existing value if already present.

Definition at line 240 of file ntv2nubaccess.cpp.

◆ keys()

NTV2StringSet NTV2Dictionary::keys ( void  ) const
Returns
My keys

Definition at line 214 of file ntv2nubaccess.cpp.

◆ largestKeySize()

size_t NTV2Dictionary::largestKeySize ( void  ) const
Returns
The length of my largest key, in bytes

Definition at line 222 of file ntv2nubaccess.cpp.

◆ largestValueSize()

size_t NTV2Dictionary::largestValueSize ( void  ) const
Returns
The length of my largest value, in bytes

Definition at line 231 of file ntv2nubaccess.cpp.

◆ Print()

ostream & NTV2Dictionary::Print ( std::ostream &  oss,
const bool  inCompact = true 
) const

Prints human-readable representation to ostream.

Definition at line 156 of file ntv2nubaccess.cpp.

◆ serialize()

bool NTV2Dictionary::serialize ( std::string &  outStr) const

Serializes my contents into the given string, returns true if string is not empty.

Definition at line 200 of file ntv2nubaccess.cpp.

◆ size()

size_t NTV2Dictionary::size ( void  ) const
inline
Returns
The number of key/value pairs I'm storing

Definition at line 118 of file ntv2nubaccess.h.

◆ u16ValueForKey()

uint16_t NTV2Dictionary::u16ValueForKey ( const std::string &  inKey,
const uint16_t  inDefault = 0 
) const
Returns
The corresponding uint16_t value for the given key, or inDefault if no such key

Definition at line 120 of file ntv2nubaccess.cpp.

◆ updateFrom()

size_t NTV2Dictionary::updateFrom ( const NTV2Dictionary inDict)

Updates all values from inDict with matching keys, ignoring all non-matching keys.

Definition at line 262 of file ntv2nubaccess.cpp.

◆ UpdateFrom()

size_t NTV2Dictionary::UpdateFrom ( const NTV2Dictionary inDict)
inline
Deprecated:
Use updateFrom instead.

Definition at line 141 of file ntv2nubaccess.h.

◆ valueForKey()

string NTV2Dictionary::valueForKey ( const std::string &  inKey) const
Returns
The corresponding value for the given key, or empty string if no such key

Definition at line 112 of file ntv2nubaccess.cpp.


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