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.

Namespaces

namespace  RMF
 The namespace for all functionality in the library.

Macros

#define RMF_DECORATOR_CATCH(extra_info)
#define RMF_FOREACH(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)
#define RMF_SHOWABLE(Name, streamed)
#define RMF_UNUSED(variable)
#define RMF_VALIDATOR(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.

Detailed Description

Copyright 2007-2022 IMP Inventors. All rights reserved.

Definition in file infrastructure_macros.h.

Macro Definition Documentation

◆ RMF_COMPARISONS

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

Definition at line 42 of file infrastructure_macros.h.

◆ RMF_DECORATOR_CATCH

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

Definition at line 162 of file infrastructure_macros.h.

◆ RMF_FOREACH

#define RMF_FOREACH ( v,
r )
Value:
for (v : r)

Definition at line 22 of file infrastructure_macros.h.

◆ RMF_FOREACH_SIMPLE_TYPE

#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)

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

See also
RMF_FOREACH_TYPE()

Definition at line 139 of file infrastructure_macros.h.

◆ RMF_FOREACH_TYPE

#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 153 of file infrastructure_macros.h.

◆ RMF_HASHABLE

#define RMF_HASHABLE ( name,
hashret )

Definition at line 81 of file infrastructure_macros.h.

◆ RMF_NO_RETURN

#define RMF_NO_RETURN ( type)
Value:
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 132 of file infrastructure_macros.h.

◆ RMF_SHOWABLE

#define RMF_SHOWABLE ( Name,
streamed )

Definition at line 103 of file infrastructure_macros.h.

◆ RMF_UNUSED

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

Suppress the unused variable compiler warning.

Definition at line 126 of file infrastructure_macros.h.

◆ RMF_VALIDATOR

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

Register a validator function. See Validator for more information.

Definition at line 169 of file infrastructure_macros.h.