KeyValue Class Reference

A key/value pair of strings. More...

#include <entitylib.h>

Inheritance diagram for KeyValue:
Inheritance graph
[legend]
Collaboration diagram for KeyValue:
Collaboration graph
[legend]

Public Types

typedef MemberCaller1
< KeyValue, const std::string
&,&KeyValue::importState > 
UndoImportCaller

Public Member Functions

 KeyValue (const char *string, const char *empty)
 ~KeyValue ()
void IncRef ()
void DecRef ()
void instanceAttach (MapFile *map)
void instanceDetach (MapFile *map)
void attach (const KeyObserver &observer)
void detach (const KeyObserver &observer)
const char * c_str () const
void assign (const std::string &other)
void notify ()
void importState (const std::string &string)

Static Public Member Functions

static void setKeyValueChangedFunc (EntityCreator::KeyValueChangedFunc func)

Private Types

typedef UnsortedSet< KeyObserverKeyObservers

Private Attributes

std::size_t m_refcount
KeyObservers m_observers
std::string m_string
const char * m_empty
ObservedUndoableObject
< std::string
m_undo

Static Private Attributes

static
EntityCreator::KeyValueChangedFunc 
m_entityKeyValueChanged

Detailed Description

A key/value pair of strings.

Definition at line 286 of file entitylib.h.


Member Typedef Documentation

Definition at line 288 of file entitylib.h.

typedef MemberCaller1<KeyValue, const std::string&, &KeyValue::importState> KeyValue::UndoImportCaller

Definition at line 372 of file entitylib.h.


Constructor & Destructor Documentation

KeyValue::KeyValue ( const char *  string,
const char *  empty 
) [inline]

Definition at line 298 of file entitylib.h.

References notify().

KeyValue::~KeyValue (  )  [inline]

Definition at line 303 of file entitylib.h.

References UnsortedSet< Value >::empty(), and m_observers.


Member Function Documentation

void KeyValue::assign ( const std::string other  )  [inline, virtual]

Implements EntityKeyValue.

Definition at line 348 of file entitylib.h.

References m_string, m_undo, and notify().

void KeyValue::attach ( const KeyObserver observer  )  [inline, virtual]

Implements EntityKeyValue.

Definition at line 333 of file entitylib.h.

References c_str(), UnsortedSet< Value >::insert(), and m_observers.

const char* KeyValue::c_str (  )  const [inline, virtual]

Implements EntityKeyValue.

Definition at line 342 of file entitylib.h.

References m_empty, and m_string.

Referenced by attach(), and notify().

void KeyValue::DecRef (  )  [inline]

Definition at line 317 of file entitylib.h.

References m_refcount.

void KeyValue::detach ( const KeyObserver observer  )  [inline, virtual]

Implements EntityKeyValue.

Definition at line 337 of file entitylib.h.

References UnsortedSet< Value >::erase(), m_empty, and m_observers.

void KeyValue::importState ( const std::string string  )  [inline]

Definition at line 366 of file entitylib.h.

References m_string, and notify().

void KeyValue::IncRef (  )  [inline]

Definition at line 313 of file entitylib.h.

References m_refcount.

void KeyValue::instanceAttach ( MapFile map  )  [inline]

Definition at line 324 of file entitylib.h.

References m_undo.

void KeyValue::instanceDetach ( MapFile map  )  [inline]

Definition at line 328 of file entitylib.h.

References m_undo.

void KeyValue::notify (  )  [inline]
static void KeyValue::setKeyValueChangedFunc ( EntityCreator::KeyValueChangedFunc  func  )  [inline, static]

Definition at line 308 of file entitylib.h.

References m_entityKeyValueChanged.


Field Documentation

const char* KeyValue::m_empty [private]

Definition at line 293 of file entitylib.h.

Referenced by c_str(), and detach().

Definition at line 295 of file entitylib.h.

Referenced by notify(), and setKeyValueChangedFunc().

Definition at line 291 of file entitylib.h.

Referenced by attach(), detach(), notify(), and ~KeyValue().

std::size_t KeyValue::m_refcount [private]

Definition at line 290 of file entitylib.h.

Referenced by DecRef(), and IncRef().

Definition at line 292 of file entitylib.h.

Referenced by assign(), c_str(), and importState().

ObservedUndoableObject<std::string> KeyValue::m_undo [private]

Definition at line 294 of file entitylib.h.

Referenced by assign(), instanceAttach(), and instanceDetach().


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

Generated by  doxygen 1.6.2