arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Key Class Reference

#include <Keys.h>

Inheritance diagram for Key:

SimBase gutz::Counted GrinderKeys List of all members.

Detailed Description

a single key use a std::numeric_limits<double>::quiet_NaN() to indicate that a value is unused.

also declared in Key. Not really designed for speed :(

Definition at line 54 of file Keys.h.

Text object-name

from SimBase

std::string getObjName ()
std::string getName ()
void setName (const char *name)

Debug prints

from SimBase: These print the object name with the error, mostly for convenience, but they are compiled to inline-no-op if you build in release mode

void derr (const char *when, const char *where=0) const
template<class T> void derr (const char *when, const char *where, const T stuff) const

Modification, AKA "changed"

from SimBase: id based, you can capture the current id for comparison later, if the id's don't match the class has been changed

virtual int getChangeID ()
virtual int getChangeID () const
virtual void setChanged ()

Serialization:

from SimBase You MUST override these pure virtual functions, they "should" do something usefull.

It is also nice if you declare a static std::istream &create(std::istream &is) const; function, to create a class from a stream. This is done on a per-concrete class basis.

These aren't pure virutal yet, but will be soon!

virtual std::ostream & saveSelf (std::ostream &os)
 serialize

virtual std::istream & readSelf (std::istream &is)
 unserialize


Public Types

typedef gutz::SmartPtr< KeyKeySP
 the key map

typedef std::map< GKeyType,
KeySP, __KeyMapCmp__
KeySPMap
typedef KeySPMap::iterator KeySPMapIter
typedef gutz::vec4d DVEC_TYPE
 data type for double 4 vectors

typedef gutz::vec4i IVEC_TYPE
 data type for integral 4 vectors

enum  KEY_TYPES {
  UNKNOWN = 0, DEFINE = 1<<0, VALUE = 1<<1, VARIABLE = 1<<2,
  CONSTANT = 1<<3, FUNCTION = 1<<4, SCOPE = 1<<5, KEY_LAST = 1<<6
}
 feel free to invent your own types, start after KEY_LAST More...


Public Member Functions

 Key ()
 Construct.

 Key (const std::string &name, int type, const KeyPair *subKeys=0, int nSubKeys=0)
virtual ~Key ()
 Construct.

std::string getName () const
 the key's name isn't the same as it's index into the key map.

void setName (std::string name)
std::string getText () const
 text, may not always be valid

void setText (std::string text)
int getType () const
void setType (int type)
virtual DVEC_TYPE getDVec () const
 for comparisons

virtual void setDVec (DVEC_TYPE vec)
virtual IVEC_TYPE getIVec () const
 for comparisons

virtual void setIVec (IVEC_TYPE vec)
KeySPMap getAllKeys () const
 these accessors will be null if there was an error, or un-found key, ie.

KeySP getKey (const GKeyType kn) const
 get a specific key, returns Null key if not found

KeySP setKey (const GKeyType kn, const KeySP key)
 set a specific key, returns Null if key not found

KeySP addKey (const GKeyType kn, const KeySP key)
 add a key

KeySP addKey (const KeyPair kp)
KeySP delKey (const GKeyType kn)
 delete a key, returns Null if key not found

bool hasKey (const GKeyType kn) const
 test if a key exists

int getOp () const
 operators, used for felt and sudo compiling

void setOp (int op)
int size ()
 size of subKey map


Public Attributes

const DVEC_TYPE DVEC_UNUSED
const IVEC_TYPE IVEC_UNUSED

Protected Member Functions

virtual void _incCount ()
 gutz::Counted interface, increment reference count by one.

virtual void _decCount ()
 gutz::Counted interface, decrement reference count by one.

virtual int _getCount () const
 gutz::Counted interface, get the current reference count.


Protected Attributes

std::string _name
std::string _text
int _type
int _op
KeySPMap _keys
DVEC_TYPE _dv
IVEC_TYPE _iv
std::string _name_
 a text name for the object, SimBase

int _changed
 change id, incremented whenever setChanged is called, SimBase


Friends

class SmartPtr
class SmartPtrRef


Member Typedef Documentation

typedef gutz::vec4d Key::DVEC_TYPE
 

data type for double 4 vectors

Definition at line 94 of file Keys.h.

Referenced by getDVec().

typedef gutz::vec4i Key::IVEC_TYPE
 

data type for integral 4 vectors

Definition at line 101 of file Keys.h.

Referenced by GrinderKeys::addPConst(), and getIVec().

typedef gutz::SmartPtr<Key> Key::KeySP
 

the key map

Definition at line 60 of file Keys.h.

Referenced by delKey(), getKey(), Key(), and setKey().

typedef std::map<GKeyType, KeySP, __KeyMapCmp__> Key::KeySPMap
 

Definition at line 61 of file Keys.h.

Referenced by getAllKeys().

typedef KeySPMap::iterator Key::KeySPMapIter
 

Definition at line 62 of file Keys.h.

Referenced by addKey(), delKey(), and setKey().


Member Enumeration Documentation

enum Key::KEY_TYPES
 

feel free to invent your own types, start after KEY_LAST

Enumeration values:
UNKNOWN 
DEFINE 
VALUE 
VARIABLE 
CONSTANT 
FUNCTION 
SCOPE 
KEY_LAST 

Definition at line 79 of file Keys.h.


Constructor & Destructor Documentation

Key::Key  ) 
 

Construct.

Definition at line 25 of file Keys.cpp.

References gutz::vec4d, and gutz::vec4i.

Referenced by addKey(), GrinderKeys::addPConst(), and Key().

Key::Key const std::string name,
int  type,
const KeyPair subKeys = 0,
int  nSubKeys = 0
 

Definition at line 35 of file Keys.cpp.

References addKey(), Key(), KeySP, name, type, gutz::vec4d, and gutz::vec4i.

Key::~Key  )  [virtual]
 

Construct.

Definition at line 54 of file Keys.cpp.


Member Function Documentation

virtual void gutz::Counted::_decCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, decrement reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 54 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

virtual int gutz::Counted::_getCount  )  const [inline, protected, virtual, inherited]
 

gutz::Counted interface, get the current reference count.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr.

Definition at line 58 of file smartptr.h.

virtual void gutz::Counted::_incCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, increment reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 48 of file smartptr.h.

Referenced by TFImage::clear(), NrroImage::fBlendOverRGBA(), and Nrro::updateMinMax().

KeySP Key::addKey const KeyPair  kp  ) 
 

Definition at line 105 of file Keys.cpp.

References addKey(), KeyPair::key, Key(), and KeyPair::kn.

KeySP Key::addKey const GKeyType  kn,
const KeySP  key
 

add a key

Definition at line 92 of file Keys.cpp.

References _keys, SimBase::derr(), and KeySPMapIter.

Referenced by addKey(), and Key().

KeySP Key::delKey const GKeyType  kn  ) 
 

delete a key, returns Null if key not found

Definition at line 114 of file Keys.cpp.

References _keys, SimBase::derr(), KeySP, and KeySPMapIter.

template<class T>
void SimBase::derr const char *  when,
const char *  where,
const T  stuff
const [inline, inherited]
 

only prints in debug mode, -D_DEBUG

Definition at line 130 of file simBase.h.

References SimBase::_name_.

void SimBase::derr const char *  when,
const char *  where = 0
const [inline, inherited]
 

only prints in debug mode, -D_DEBUG

Definition at line 113 of file simBase.h.

References SimBase::_name_.

Referenced by AlgObj::addInput(), addKey(), SourceObj::addOutput(), VolShader::bindBlend(), VolField::checkDims(), VolFieldVec::checkField(), VolFieldVec::checkFields(), AlgObj::checkInputs(), AlgObj::delInput(), delKey(), Crank::delMP(), SourceObj::delOutput(), Crank::delTape(), TFGeneric::eval(), SourceObj::execDef(), ColorMapper::execDef(), AlgObj::execDef(), AlgObj::execute(), SourceObj::force(), AlgObj::force(), VolField::genTexture(), TFGeneric::get2DMap(), DataObj::getConsumer(), VolFieldVec::getField(), AlgObj::getInputN(), getKey(), Crank::getMP(), Crank::getMPIdx(), SourceObj::getOutputN(), Crank::getTape(), AlgObj::inputsModified(), Crank::insertTape(), Crank::kindErr(), VolyCube::loadNrro(), VolyCube::readState(), Volytope::readState(), SourceObj::request(), DataObj::request_(), VolytopeVec::setField(), SourceObj::setForwardModified(), DataObj::setForwardModified(), TFGeneric::setImage(), AlgObj::setInputN(), setKey(), Crank::setMP(), VolField::setNrro(), SourceObj::setOutputN(), Crank::setTape(), Volume::update(), SourceObj::updateOutputs(), Volume::updateRectLin(), Volume::updateVolytopesRL(), VolyCube::VolyCube(), and Volytope::writeState().

KeySPMap Key::getAllKeys  )  const [inline]
 

these accessors will be null if there was an error, or un-found key, ie.

retKey.isNull() == true a key may have sub keys, get them...

Definition at line 110 of file Keys.h.

References _keys, and KeySPMap.

virtual int SimBase::getChangeID  )  const [inline, virtual, inherited]
 

Definition at line 73 of file simBase.h.

References SimBase::_changed.

virtual int SimBase::getChangeID  )  [inline, virtual, inherited]
 

Reimplemented in TFGeneric, TFBaseSP, and TFEltSP.

Definition at line 72 of file simBase.h.

References SimBase::_changed.

Referenced by TFEltSP::getChangeID(), TFBaseSP::getChangeID(), and TFGeneric::getChangeID().

virtual DVEC_TYPE Key::getDVec  )  const [inline, virtual]
 

for comparisons

Definition at line 97 of file Keys.h.

References _dv, and DVEC_TYPE.

virtual IVEC_TYPE Key::getIVec  )  const [inline, virtual]
 

for comparisons

Definition at line 104 of file Keys.h.

References _iv, and IVEC_TYPE.

KeySP Key::getKey const GKeyType  kn  )  const
 

get a specific key, returns Null key if not found

Definition at line 61 of file Keys.cpp.

References _keys, SimBase::derr(), and KeySP.

Referenced by GrinderKeys::env(), GrinderKeys::pconst(), GrinderKeys::pos(), and GrinderKeys::val().

std::string SimBase::getName  )  [inline, inherited]
 

Definition at line 45 of file simBase.h.

References SimBase::_name_.

Referenced by MetaProg::operator<<().

std::string Key::getName  )  const [inline]
 

the key's name isn't the same as it's index into the key map.

Definition at line 70 of file Keys.h.

References _name.

std::string SimBase::getObjName  )  [inline, inherited]
 

Definition at line 44 of file simBase.h.

References string.

int Key::getOp  )  const [inline]
 

operators, used for felt and sudo compiling

Definition at line 124 of file Keys.h.

References _op.

std::string Key::getText  )  const [inline]
 

text, may not always be valid

Definition at line 74 of file Keys.h.

References _text.

int Key::getType  )  const [inline]
 

Definition at line 90 of file Keys.h.

References _type.

bool Key::hasKey const GKeyType  kn  )  const
 

test if a key exists

Definition at line 130 of file Keys.cpp.

References _keys.

virtual std::istream& SimBase::readSelf std::istream &  is  )  [inline, virtual, inherited]
 

unserialize

Reimplemented in SimCore, and VolRenBase.

Definition at line 94 of file simBase.h.

virtual std::ostream& SimBase::saveSelf std::ostream &  os  )  [inline, virtual, inherited]
 

serialize

Reimplemented in SimCore, and VolRenBase.

Definition at line 92 of file simBase.h.

virtual void SimBase::setChanged  )  [inline, virtual, inherited]
 

Definition at line 74 of file simBase.h.

References SimBase::_changed.

Referenced by TFEltSP::getChangeID(), TFBaseSP::getChangeID(), TFBaseSP::operator=(), and TFGeneric::update().

virtual void Key::setDVec DVEC_TYPE  vec  )  [inline, virtual]
 

Definition at line 98 of file Keys.h.

References _dv.

virtual void Key::setIVec IVEC_TYPE  vec  )  [inline, virtual]
 

Definition at line 105 of file Keys.h.

References _iv.

KeySP Key::setKey const GKeyType  kn,
const KeySP  key
 

set a specific key, returns Null if key not found

Definition at line 76 of file Keys.cpp.

References _keys, SimBase::derr(), KeySP, and KeySPMapIter.

void SimBase::setName const char *  name  )  [inline, inherited]
 

Definition at line 47 of file simBase.h.

References SimBase::_name_, and name.

void Key::setName std::string  name  )  [inline]
 

Reimplemented from SimBase.

Definition at line 71 of file Keys.h.

References _name, and name.

void Key::setOp int  op  )  [inline]
 

Definition at line 125 of file Keys.h.

References _op.

void Key::setText std::string  text  )  [inline]
 

Definition at line 75 of file Keys.h.

References _text.

void Key::setType int  type  )  [inline]
 

Definition at line 91 of file Keys.h.

References _type, and type.

int Key::size  )  [inline]
 

size of subKey map

Definition at line 128 of file Keys.h.

References _keys.

Referenced by GrinderKeys::addPConst().


Friends And Related Function Documentation

friend class SmartPtr [friend, inherited]
 

Definition at line 40 of file smartptr.h.

Referenced by Nrro::NrroIter< T >::NrroIter().

friend class SmartPtrRef [friend, inherited]
 

Definition at line 41 of file smartptr.h.


Member Data Documentation

int SimBase::_changed [protected, inherited]
 

change id, incremented whenever setChanged is called, SimBase

Definition at line 103 of file simBase.h.

Referenced by SimBase::getChangeID(), SimBase::setChanged(), and SimBase::SimBase().

DVEC_TYPE Key::_dv [protected]
 

Definition at line 137 of file Keys.h.

Referenced by getDVec(), and setDVec().

IVEC_TYPE Key::_iv [protected]
 

Definition at line 138 of file Keys.h.

Referenced by getIVec(), and setIVec().

KeySPMap Key::_keys [protected]
 

Definition at line 135 of file Keys.h.

Referenced by addKey(), delKey(), getAllKeys(), getKey(), hasKey(), setKey(), and size().

std::string Key::_name [protected]
 

Definition at line 131 of file Keys.h.

Referenced by getName(), and setName().

std::string SimBase::_name_ [protected, inherited]
 

a text name for the object, SimBase

Definition at line 101 of file simBase.h.

Referenced by SimBase::derr(), SimBase::getName(), SimBase::setName(), and SimBase::SimBase().

int Key::_op [protected]
 

Definition at line 134 of file Keys.h.

Referenced by getOp(), and setOp().

std::string Key::_text [protected]
 

Definition at line 132 of file Keys.h.

Referenced by getText(), and setText().

int Key::_type [protected]
 

Definition at line 133 of file Keys.h.

Referenced by getType(), and setType().

const DVEC_TYPE Key::DVEC_UNUSED
 

Definition at line 95 of file Keys.h.

const IVEC_TYPE Key::IVEC_UNUSED
 

Definition at line 102 of file Keys.h.


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk