IMP Reference Guide
2.22.0
The Integrative Modeling Platform
|
Macros to define containers of objects. More...
#include <IMP/kernel_config.h>
#include <IMP/check_macros.h>
#include <IMP/internal/Vector.h>
#include <IMP/SetCheckState.h>
#include <IMP/log_macros.h>
#include <IMP/doxygen_macros.h>
#include <algorithm>
Go to the source code of this file.
Macros | |
#define | IMP_CONTAINER_ACCESS(ContainerType, container, operation) |
#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_LIST_PYTHON_IMPL(lcname, lcnames, ucnames, Ucnames) |
#define | IMP_PROTECTION(protection) protection: |
Macros to define containers of objects.
Copyright 2007-2022 IMP Inventors. All rights reserved.
Definition in file 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 424 of file 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 perform. In operation, _1 is used to refer to the item using its ContainedIndexType (e.g., IMP::ParticleIndex in SingletonContainer, or IMP::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 418 of file 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 399 of file container_macros.h.
#define IMP_EXPOSE_ITERATORS | ( | ContainerType, | |
container_name, | |||
Ucname, | |||
Ucnames, | |||
lcname, | |||
lcnames | |||
) |
Internal use only.
Definition at line 29 of file container_macros.h.
#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
[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 127 of file container_macros.h.
#define IMP_LIST_IMPL | ( | Class, | |
Ucname, | |||
lcname, | |||
Data, | |||
PluralData | |||
) |
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.
[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 356 of file container_macros.h.