IMP
2.2.1
The Integrative Modeling Platform
|
Macros to define containers of objects. More...
#include <IMP/kernel/kernel_config.h>
#include <IMP/base/check_macros.h>
#include <IMP/base/internal/Vector.h>
#include <IMP/base/SetCheckState.h>
#include <IMP/base/log_macros.h>
#include <IMP/base/doxygen_macros.h>
#include <algorithm>
Go to the source code of this file.
Macros | |
#define | IMP_CONTAINER_ACCESS(ContainerType, container, operation) |
#define | IMP_CONTAINER_DEPENDENCIES(Name, input_deps) |
#define | IMP_CONTAINER_FOREACH(ContainerType, container, operation) IMP_CONTAINER_FOREACH_IMPL(ContainerType, container, operation, ) |
#define | IMP_CONTAINER_FOREACH_IMPL(ContainerType, container, operation, tname) |
#define | IMP_CONTAINER_FOREACH_LOOP(ContainerType, container, operation, tname) |
#define | IMP_CONTAINER_FOREACH_TEMPLATE(ContainerType, container, operation) IMP_CONTAINER_FOREACH_IMPL(ContainerType, container, operation, typename) |
#define | IMP_EXPOSE_ITERATORS(ContainerType, container_name, Ucname, Ucnames, lcname, lcnames) |
#define | IMP_FORCE_EXPORT(x) x |
#define | IMP_LIST(protection, Ucname, lcname, Data, PluralData) |
A macro to provide a uniform interface for storing lists of objects. More... | |
#define | IMP_LIST_ACTION(protection, Ucname, Ucnames, lcname, lcnames, Data, PluralData, OnAdd, OnChanged, OnRemoved) |
#define | IMP_LIST_ACTION_IMPL(Class, Ucname, Ucnames, lcname, lcnames, Data, PluralData) |
#define | IMP_LIST_IMPL(Class, Ucname, lcname, Data, PluralData) |
This should go in a .cpp file for the respective class. More... | |
#define | IMP_PROTECTION(protection) protection: |
Copyright 2007-2014 IMP Inventors. All rights reserved.
Definition in file kernel/container_macros.h.
#define IMP_CONTAINER_ACCESS | ( | ContainerType, | |
container, | |||
operation | |||
) |
Provide a block that can have efficient, direct access to the contents of the container in the variable imp_indexes.
Definition at line 389 of file kernel/container_macros.h.
#define IMP_CONTAINER_DEPENDENCIES | ( | Name, | |
input_deps | |||
) |
Report dependencies of the container Name. Add the line deps_(new DependenciesScoreState(this), model) to the constructor initializer list. The input_deps argument should add the input containers to a variable ret.
Definition at line 308 of file kernel/container_macros.h.
#define IMP_CONTAINER_FOREACH | ( | ContainerType, | |
container, | |||
operation | |||
) | IMP_CONTAINER_FOREACH_IMPL(ContainerType, container, operation, ) |
These macros avoid various inefficiencies.
The macros take the name of the container and the operation to peform. In operation, _1 is used to refer to the item using its ContainedIndexType (e.g., IMP::kernel::ParticleIndex in SingletonContainer, or IMP::kernel::ParticleIndexPair in PairContainer). The location of this item in the container itself is _2. Use it like:
See IMP_CONTAINER_FOREACH_TEMPLATE() if you want to use it in a template function.
Definition at line 383 of file kernel/container_macros.h.
#define IMP_CONTAINER_FOREACH_TEMPLATE | ( | ContainerType, | |
container, | |||
operation | |||
) | IMP_CONTAINER_FOREACH_IMPL(ContainerType, container, operation, typename) |
This version is for use in a template function. See IMP_FOREACH_INDEX() for another version.
Definition at line 364 of file kernel/container_macros.h.
#define IMP_EXPOSE_ITERATORS | ( | ContainerType, | |
container_name, | |||
Ucname, | |||
Ucnames, | |||
lcname, | |||
lcnames | |||
) |
Internal use only.
Definition at line 29 of file kernel/container_macros.h.
#define IMP_LIST | ( | protection, | |
Ucname, | |||
lcname, | |||
Data, | |||
PluralData | |||
) |
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
[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.
@name short description longer description @{and ending with one like
@}
Definition at line 90 of file kernel/container_macros.h.
#define IMP_LIST_IMPL | ( | Class, | |
Ucname, | |||
lcname, | |||
Data, | |||
PluralData | |||
) |
This code should go in a .cpp file. One macro for each IMP_CONTAINER.
[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. |
For all of these the current object is called obj and is of type Data.
Definition at line 289 of file kernel/container_macros.h.