Tekkotsu 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
Revision
1.7
State
Exp
Date
2006/09/11 23:05:15

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)


Tekkotsu v3.0
Generated Fri May 11 20:07:32 2007 by Doxygen 1.4.7