RMF
infrastructure_macros.h File Reference

Various general useful macros for IMP. More...

#include <sstream>
#include <iostream>
#include <string>
#include "RMF/compiler_macros.h"
#include "internal/use.h"
#include <vector>
#include <boost/config.hpp>
#include <boost/version.hpp>
+ Include dependency graph for infrastructure_macros.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RMF::Nullable< Tr >
 Return a possibly null value. More...
 

Namespaces

 RMF
 The namespace for all functionality in the library.
 

Macros

#define RMF_DECORATOR_CATCH(extra_info)
 
#define RMF_FOREACH(v, r)   for (v : r)
 
#define RMF_FOREACH_SIMPLE_TYPE(macroname)
 
#define RMF_FOREACH_TYPE(macroname)
 
#define RMF_HASHABLE(name, hashret)
 Implement a hash function for the class.
 
#define RMF_NO_RETURN(type)   return type()
 
#define RMF_SHOWABLE(Name, streamed)
 
#define RMF_UNUSED(variable)   RMF::internal::use(variable);
 
#define RMF_VALIDATOR(Type)   RMF::Registrar<Type> Type##Reg(#Type);
 

Comparisons

Helper macros for implementing comparisons in terms of either member variables or a member compare function. All of the <,>,== etc are implemented for both C++ and Python.

#define RMF_COMPARISONS(Name)
 Implement comparison in a class using field as the variable to compare. More...
 

Detailed Description

Copyright 2007-2022 IMP Inventors. All rights reserved.

Definition in file infrastructure_macros.h.

Macro Definition Documentation

#define RMF_COMPARISONS (   Name)
Parameters
[in]Namethe name of the class

Definition at line 42 of file infrastructure_macros.h.

#define RMF_DECORATOR_CATCH (   extra_info)
Value:
catch (Exception& e) { \
RMF_RETHROW(Decorator(get_decorator_type_name()) extra_info, e); \
}

Definition at line 165 of file infrastructure_macros.h.

#define RMF_FOREACH_SIMPLE_TYPE (   macroname)
Value:
macroname(int, Int, int, int, const Ints&, Ints); \
macroname(float, Float, float, float, const Floats&, Floats); \
macroname(index, Index, int, int, const Ints&, Ints)
float Float
Definition: types.h:33
int Index
Definition: HDF5/types.h:38
std::vector< Int > Ints
Definition: types.h:31
std::vector< Float > Floats
Definition: types.h:35
int Int
Definition: types.h:29

Apply the macro to each supported constant size type (e.g. int as opposed to string).

See Also
RMF_FOREACH_TYPE()

Definition at line 142 of file infrastructure_macros.h.

#define RMF_FOREACH_TYPE (   macroname)

Expand to applying the macro to each type supported by the RMF library. The macro should take six arguments

  • the lower case name of the type
  • the upper case name
  • the C++ type for accepting the value
  • the C++ type for returning the value
  • the C++ type for accepting more than one value
  • the C++ type for returning more than one value

Definition at line 156 of file infrastructure_macros.h.

#define RMF_NO_RETURN (   type)    return type()

Provide a dummy return for something that doesn't return.

This is a nasty hack to suppress warnings in some compilers.

Definition at line 135 of file infrastructure_macros.h.

#define RMF_UNUSED (   variable)    RMF::internal::use(variable);

Suppress the unused variable compiler warning.

Definition at line 129 of file infrastructure_macros.h.

#define RMF_VALIDATOR (   Type)    RMF::Registrar<Type> Type##Reg(#Type);

Register a validator function. See Validator for more information.

Definition at line 172 of file infrastructure_macros.h.