[ Lit Window Library at SourceForge[ Lit Window Productions Homepage ]  [ wxWidgets Tips&Tricks ]  [  wxVisualSetup ]

Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

const_accessor Class Reference
[Data adapters]

Provides basic readonly access to objects of any kind. More...

Inheritance diagram for const_accessor:

Inheritance graph
[legend]
List of all members.

Public Types

typedef litwindow::const_aggregate aggregate_type
typedef litwindow::const_container container_type

Public Member Functions

void assert_valid () const
 assert the validness of the accessor, throw an exception if it is invalid.
string class_name () const
 Get the name of the class of this object if it is a member of an aggregate. Returns 0 if it is a basic data type.
const_accessor clone () const
 Clone the underlying object.
 const_accessor (const void *aThisPtr, const schema_entry &e)
 const_accessor (const void *aThisPtr, const schema_base::const_iterator &aThisInfo)
 const_accessor ()
void destroy ()
 Destroy a cloned object.
const_aggregate get_aggregate () const
 Return an aggregate accessor for this object.
const_container get_container () const
 Return a container accessor for this object.
const_prop_ptr get_member_ptr () const
string get_name () const
 same as name()
const schema_entry & get_schema_entry () const
const void * get_this_ptr () const
prop_t get_type () const
 return the type of the object.
const string get_type_name () const
 Get the type name of the object. Same as type_name().
bool has_copy () const
 Returns true if the underlying object can be copied.
bool is_aggregate () const
 Return true if the accessor points to an aggregate.
bool is_alias_of (const const_accessor &c) const
bool is_container () const
 Return true if the accessor points to a container.
bool is_coobject () const
bool is_inherited () const
bool is_int () const
 Return true if the type is an integer type.
bool is_nested () const
bool is_valid () const
 Returns true if the accessor is valid (points to an existing object).
string name () const
 Get the name of this object if it is a member of an aggregate. Returns "this" if it is a basic data type.
bool operator!= (const const_accessor &a) const
 compare two accessors.
bool operator< (const const_accessor &a) const
 compare two accessors.
bool operator== (const const_accessor &a) const
 compare two accessors.
bool operator> (const const_accessor &a) const
void set_invalid ()
 mark the accessor as 'invalid'.
int to_int () const
 Return an 'int' representation of this object.
propString to_string () const
 Return a string representation of the value of the object.
const string type_name () const
 Get the type name of the object.
bool is_type (const const_accessor &a) const
bool is_type (prop_t type) const

Protected Attributes

const_prop_ptr member_ptr
const schema_entry * s_entry
const void * this_ptr

Detailed Description

A const_accessor can point to objects of any kind and provides basic readonly access to the values of these objects. const_accessor treats the objects pointed to as 'atomic'. They can access the objects as a whole, but cannot access individual aspects - such as members - of the objects. Use aggregate if the object is an aggregate (struct or class) or container if the object is a container.


Member Typedef Documentation

typedef litwindow::const_aggregate aggregate_type
 

Reimplemented in accessor.

typedef litwindow::const_container container_type
 

Reimplemented in accessor.


Constructor & Destructor Documentation

const_accessor  ) 
 

const_accessor const void *  aThisPtr,
const schema_base::const_iterator &  aThisInfo
 

const_accessor const void *  aThisPtr,
const schema_entry &  e
 


Member Function Documentation

void assert_valid  )  const
 

Reimplemented in typed_const_accessor.

string class_name  )  const
 

void destroy  ) 
 

This function calls 'delete' for the object pointed to by this accessor.

Note:
Calling 'destroy' for accessors that have not been created by clone or a similar function is illegal. The result is undefined. An access violation, memory corruption or other such things may happen.

const_container get_container  )  const
 

It is valid to call get_container for an object that isn't a container. If thats the case const_container::is_valid() will return false for the returned container accessor.

Reimplemented in accessor.

const_prop_ptr get_member_ptr  )  const
 

Reimplemented in accessor.

string get_name  )  const
 

const schema_entry& get_schema_entry  )  const
 

const void* get_this_ptr  )  const
 

Reimplemented in accessor.

prop_t get_type  )  const
 

const string get_type_name  )  const
 

bool has_copy  )  const
 

bool is_aggregate  )  const
 

bool is_alias_of const const_accessor c  )  const
 

return true if c is an alias of this. Similar to operator==

bool is_container  )  const
 

bool is_coobject  )  const
 

bool is_inherited  )  const
 

bool is_int  )  const
 

bool is_nested  )  const
 

bool is_type const const_accessor a  )  const
 

bool is_type prop_t  type  )  const
 

compares the type of this object to type.

Returns:
true if this object is of type.
Note:
Use of the template function is_type<Type>(a) is recommended instead.

bool is_valid  )  const
 

Reimplemented in typed_const_accessor.

string name  )  const
 

bool operator!= const const_accessor a  )  const
 

Returns:
true if the accessors point to different objects.

bool operator< const const_accessor a  )  const
 

Returns:
true if this is smaller than a. Used for map<const_accessor, ...>.

bool operator== const const_accessor a  )  const
 

Returns:
true if the accessors access the same object (similar to pointer equality).

bool operator> const const_accessor a  )  const
 

void set_invalid  ) 
 

subsequent calls to is_valid() will return false.

int to_int  )  const
 

propString to_string  )  const
 

const string type_name  )  const
 


Member Data Documentation

const_prop_ptr member_ptr [protected]
 

const schema_entry* s_entry [protected]
 

const void* this_ptr [protected]
 


Copyright 2004, Hajo Kirchhoff, Lit Window Productions