IMP logo

container_macros.h File Reference

Macros to define containers of objects. More...

Include dependency graph for container_macros.h:

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

Go to the source code of this file.


Defines

#define IMP_EXPOSE_ITERATORS(ContainerType, container_name, Ucname, lcname)
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
 A macro to provide a uniform interface for storing lists of objects.
#define IMP_LIST_IMPL(Class, Ucname, lcname, Data, PluralData, OnAdd,OnChanged, OnRemoved)
 This should go in a .cpp file for the respective class.
#define IMP_PROTECTION(protection)   protection:

Detailed Description

Macros to define containers of objects.

Copyright 2007-2010 IMP Inventors. All rights reserved.


Define Documentation

#define IMP_EXPOSE_ITERATORS ( ContainerType,
container_name,
Ucname,
lcname   ) 

Internal use only.

#define IMP_LIST ( protection,
Ucname,
lcname,
Data,
PluralData   ) 

A macro to provide a uniform interface for storing lists of objects.

This macro is designed to be used in the body of an object to add a set of methods for manipulating a list of contained objects. It adds methods

  • get_foo
  • set_foo
  • set_foos
  • foos_begin, foos_end
  • remove_foo
  • remove_foos etc. where foo is the lcname provided.

Parameters:
[in] protection The level of protection for the container (public, private).
[in] Ucname The name of the type of container in uppercase.
[in] lcname The name of the type of container in lower case.
[in] Data The type of the data to store.
[in] PluralData The plural of the data name. This should be a container type.
An accompanying IMP_LIST_IMPL must go in a .cpp file.

Note:
This macro should be given an appropriate name and wrapped in a doxygen comment block such as by starting with a C++ comment like
     @name short description
     longer description
     @{
     
and ending with one like
     @}
     

#define IMP_LIST_IMPL ( Class,
Ucname,
lcname,
Data,
PluralData,
OnAdd,
OnChanged,
OnRemoved   ) 

This should go in a .cpp file for the respective class.

This code should go in a .cpp file. One macro for each IMP_CONTAINER.

Parameters:
[in] Class The name of the class containing this container.
[in] Ucname The name of the type of container in uppercase.
[in] lcname The name of the type of container in lower case.
[in] Data The type of the data to store.
[in] PluralData The plural of the data name. This should be a container type.
[in] OnAdd Code to modify the passed in object. The object is obj and its index index.
[in] OnChanged Code to get executed when the container changes.
[in] OnRemoved Code to get executed when the an object is removed.
For all of these the current object is called obj.


Generated on Mon Mar 8 23:04:36 2010 for IMP by doxygen 1.5.8