Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes | List of all members
vl::KeyValues Class Reference

A set of key/value pairs usually used to associate generic information, tags, attributes etc. to another class. More...

#include <KeyValues.hpp>

+ Inheritance diagram for vl::KeyValues:

Public Member Functions

 KeyValues ()
 
bool has (const String &key) const
 
String value (const String &key) const
 
Stringset (const String &key)
 
void erase (const String &key)
 
void getKeys (std::vector< String > &keys) const
 
void clear ()
 
const std::map< String, String > & keyValueMap () const
 
std::map< String, String > & keyValueMap ()
 
void print ()
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Attributes

std::map< String, StringmKeyValues
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

A set of key/value pairs usually used to associate generic information, tags, attributes etc. to another class.

Definition at line 42 of file KeyValues.hpp.

Constructor & Destructor Documentation

◆ KeyValues()

KeyValues::KeyValues ( )

Definition at line 39 of file KeyValues.cpp.

Member Function Documentation

◆ clear()

void vl::KeyValues::clear ( )
inline

Definition at line 59 of file KeyValues.hpp.

Referenced by vl::Molecule::reset().

◆ erase()

void vl::KeyValues::erase ( const String key)
inline

Definition at line 55 of file KeyValues.hpp.

◆ getKeys()

void KeyValues::getKeys ( std::vector< String > &  keys) const

Definition at line 56 of file KeyValues.cpp.

References mKeyValues.

◆ has()

bool vl::KeyValues::has ( const String key) const
inline

Definition at line 49 of file KeyValues.hpp.

◆ keyValueMap() [1/2]

const std::map<String,String>& vl::KeyValues::keyValueMap ( ) const
inline

Definition at line 61 of file KeyValues.hpp.

Referenced by vl::loadMHD().

◆ keyValueMap() [2/2]

std::map<String,String>& vl::KeyValues::keyValueMap ( )
inline

Definition at line 63 of file KeyValues.hpp.

◆ print()

void KeyValues::print ( )

Definition at line 63 of file KeyValues.cpp.

References mKeyValues, and vl::Log::print().

Referenced by vl::loadDICOM().

◆ set()

String& vl::KeyValues::set ( const String key)
inline

Definition at line 53 of file KeyValues.hpp.

Referenced by vl::loadDICOM(), vl::loadMHD(), and vl::loadMOL2().

◆ value()

String KeyValues::value ( const String key) const

Definition at line 44 of file KeyValues.cpp.

References vl::Log::error(), and mKeyValues.

Referenced by vl::Image::contrastHounsfieldAuto().

Member Data Documentation

◆ mKeyValues

std::map<String,String> vl::KeyValues::mKeyValues
protected

Definition at line 68 of file KeyValues.hpp.

Referenced by getKeys(), print(), and value().


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