IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
value_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/value_macros.h
3  * \brief Macros to help in implementing Value objects.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_VALUE_MACROS_H
10 #define IMPKERNEL_VALUE_MACROS_H
11 #include <IMP/kernel_config.h>
12 #include "Vector.h"
13 
14 //! Define the type for storing sets of values
15 /** The macro defines the type Names. PluralName should be
16  Names unless the English spelling is
17  different. This macro also defines the output operator
18  for the type.
19 
20  See \ref values "Value and Objects" for a description of what
21  it means to be an object vs a value in \imp.
22  */
23 #define IMP_VALUES(Name, PluralName) \
24  /** Pass or store a set of Name. */ typedef IMP::Vector<Name> PluralName
25 
26 //! Like IMP_VALUES but using CUDA unified memory
27 #define IMP_VALUES_UNIFIED(Name, PluralName) \
28  /** Pass or store a set of Name using CUDA unified memory. */ \
29  typedef IMP::Vector<Name, IMP_VECTOR_ALLOCATOR<Name>> PluralName
30 
31 /** To be used with native types.*/
32 #define IMP_BUILTIN_VALUES(Name, PluralName) \
33  IMP_VALUES(Name, PluralName); \
34  IMP_VALUES(PluralName, PluralName##s)
35 
36 #endif /* IMPKERNEL_VALUE_MACROS_H */
A class for storing lists of IMP items.