Homepage Demos Overview Downloads Tutorials Reference
Credits

WMclass.h File Reference


Detailed Description

Watchable memory. Variables are monitored and changes are announced.

Author:
dst (Creator)

alokl (Ported)

Author
ejt
Name
tekkotsu-2_1
Revision
1.3
State
Rel
Date
2003/10/10 17:46:04

These macros allow you to quickly create a WM variable, but only if
it's staticly defined - you can't use these with a dynamic number of variables. You'll have to manually create a WMitem<T> or another subclass of WMitem_base if you want define these on the fly... it's not hard to do, just look at the macro definitions.
WMvar(type,name) declares the variable in the registry
GlobalWM.
WMvari(type,name,initval) declares the variable in GlobalWM
and initializes it if it doesn't already exist.
WMvar_(type,name,registry) declares the variable in the
specified registry.
WMvari_(type,name,initval,registry) declares the variable in
the specified registry and initializes it if it doesn't already exist.
WMreg(name) declares a new WMregistry as a variable in
GlobalWM.
WMreg(name,registry) declares a new WMregistry as a variable
in the specified registry,
Examples:

Definition in file WMclass.h.

#include <string>
#include <vector>
#include <iostream>
#include "Events/EventRouter.h"

Include dependency graph for WMclass.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

class  WMentry
 A WMentry is an entry in a WMregistry. More...

class  WMitem
 WMitem<T> is a reference to the variable of type T described by the associated WMentry. More...

class  WMitem_base
 WMitem_base is the base class from which all WMitem<T> subclasses are derived. More...

class  WMregistry
 A WMregistry is a namespace; it holds a collection of WMEntry instances describing the variables that live in this registry. More...


Global Lookup functions

Three versions of lookup_WMentry with different argument types, and one version of create_WMentry, which they share.

template<typename T> WMitem< T > lookup_WMentry (const std::string &iname, const std::string &tname, const std::string &regname)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

template<typename T> WMitem< T > lookup_WMentry (const std::string &iname, const std::string &tname, const WMregistry &reg)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

template<typename T> WMitem< T > lookup_WMentry (const std::string &iname, const std::string &tname, const T &initval, WMregistry &reg)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

template<typename T> WMitem< T > create_WMentry (const std::string &iname, const std::string &tname, const T *const value, WMregistry &reg)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

WMitem< WMregistrylookup_reg (const std::string &name, WMregistry &registry)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

void dump (const WMitem< WMregistry > &wmreg)
 The lookup_reg function is defined in WMclass.cc since it's not templated.

WMregistry GlobalWM
 the global registry for all others to put their stuff in


Defines

#define WM_max_stringlen   60
 Maximum displayed length of a char* or std::string variable.

#define WMvar(T, name)   static WMitem<T> name(lookup_WMentry<T>(#name,#T,GlobalWM));
 Allows you to create a static WMvar.

#define WMvari(T, name, initval)   static WMitem<T> name(lookup_WMentry<T>(#name,#T,initval,GlobalWM));
 Allows you to create a static WMvar with a default initialization value.

#define WMvar_(T, name, registry)   static WMitem<T> name(lookup_WMentry<T>(#name,#T,registry));
 Allows you to create a static WMvar in a registry with a default initialization value.

#define WMvari_(T, name, initval, registry)   static WMitem<T> name(lookup_WMentry<T>(#name,#T,initval,registry));
 Allows you to create a static WMvar in a registry with a default initialization value.

#define WMreg(name)   static WMitem<WMregistry> name(lookup_reg(#name,GlobalWM));
 Allows you to create a new static registry.

#define WMreg_(name, parent)   static WMitem<WMregistry> name(lookup_reg(#name,parent));
 Allows you to create a new static registry with a parent registry.


Functions

template<typename T> WMitem< T > lookup_WMentry (const std::string &iname, const std::string &tname, WMregistry &reg)
template<typename T> WMitem< T > create_WMentry (const std::string &iname, const std::string &tname, T *const value, WMregistry &reg)


Define Documentation

#define WM_max_stringlen   60
 

Maximum displayed length of a char* or std::string variable.

Definition at line 54 of file WMclass.h.

Referenced by WMitem< std::string >::toString().

#define WMreg name   )     static WMitem<WMregistry> name(lookup_reg(#name,GlobalWM));
 

Allows you to create a new static registry.

Definition at line 203 of file WMclass.h.

Referenced by ChaseBallBehavior::processEvent().

#define WMreg_ name,
parent   )     static WMitem<WMregistry> name(lookup_reg(#name,parent));
 

Allows you to create a new static registry with a parent registry.

Definition at line 207 of file WMclass.h.

#define WMvar T,
name   )     static WMitem<T> name(lookup_WMentry<T>(#name,#T,GlobalWM));
 

Allows you to create a static WMvar.

Definition at line 187 of file WMclass.h.

#define WMvar_ T,
name,
registry   )     static WMitem<T> name(lookup_WMentry<T>(#name,#T,registry));
 

Allows you to create a static WMvar in a registry with a default initialization value.

Definition at line 195 of file WMclass.h.

#define WMvari T,
name,
initval   )     static WMitem<T> name(lookup_WMentry<T>(#name,#T,initval,GlobalWM));
 

Allows you to create a static WMvar with a default initialization value.

Definition at line 191 of file WMclass.h.

Referenced by MMCombo::GotImage().

#define WMvari_ T,
name,
initval,
registry   )     static WMitem<T> name(lookup_WMentry<T>(#name,#T,initval,registry));
 

Allows you to create a static WMvar in a registry with a default initialization value.

Definition at line 199 of file WMclass.h.

Referenced by ChaseBallBehavior::processEvent().


Function Documentation

template<typename T>
WMitem<T> create_WMentry const std::string &  iname,
const std::string &  tname,
T *const  value,
WMregistry reg
 

Definition at line 385 of file WMclass.h.

Referenced by lookup_reg(), and lookup_WMentry().

template<typename T>
WMitem<T> create_WMentry const std::string &  iname,
const std::string &  tname,
const T *const  value,
WMregistry reg
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

void dump const WMitem< WMregistry > &  wmreg  ) 
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

Definition at line 96 of file WMclass.cc.

WMitem<WMregistry> lookup_reg const std::string &  name,
WMregistry registry
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

Definition at line 77 of file WMclass.cc.

template<typename T>
WMitem<T> lookup_WMentry const std::string &  iname,
const std::string &  tname,
WMregistry reg
 

Definition at line 363 of file WMclass.h.

template<typename T>
WMitem< T > lookup_WMentry const std::string &  iname,
const std::string &  tname,
const T &  initval,
WMregistry reg
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

Definition at line 374 of file WMclass.h.

template<typename T>
WMitem<T> lookup_WMentry const std::string &  iname,
const std::string &  tname,
const WMregistry reg
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

template<typename T>
WMitem< T > lookup_WMentry const std::string &  iname,
const std::string &  tname,
const std::string &  regname
 

The lookup_reg function is defined in WMclass.cc since it's not templated.

Definition at line 345 of file WMclass.h.


Variable Documentation

WMregistry GlobalWM
 

the global registry for all others to put their stuff in

Definition at line 239 of file WMclass.h.

Referenced by WMMonitorBehavior::find(), lookup_WMentry(), WMMonitorBehavior::processEvent(), and WMMonitorBehavior::registerData().


Tekkotsu v2.1
Generated Tue Mar 16 23:21:53 2004 by Doxygen 1.3.5