Homepage
Demos
Overview
Downloads
Dev. Resources
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_4_1
Revision
1.5
State
Exp
Date
2005/07/26 03:22: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:

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

Go to the source code of this file.

Classes

class  WMregistry
 A WMregistry is a namespace; it holds a collection of WMEntry instances describing the variables that live in this registry. More...
class  WMentry
 A WMentry is an entry in a WMregistry. More...
class  WMitem_base
 WMitem_base is the base class from which all WMitem<T> subclasses are derived. More...
class  WMitem< T >
 WMitem<T> is a reference to the variable of type T described by the associated WMentry. 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< T >::toString().

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

Allows you to create a new static registry.

Definition at line 204 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 208 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 188 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 196 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 192 of file WMclass.h.

#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 200 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 386 of file WMclass.h.

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.

Referenced by lookup_reg(), and lookup_WMentry().

void dump const WMitem< WMregistry > &  wmreg  ) 
 

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

Definition at line 100 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 81 of file WMclass.cc.

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

Definition at line 364 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 375 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 346 of file WMclass.h.


Variable Documentation

WMregistry GlobalWM
 

the global registry for all others to put their stuff in

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


Tekkotsu v2.4.1
Generated Tue Aug 16 16:34:50 2005 by Doxygen 1.4.4