MeshLib Documentation
Loading...
Searching...
No Matches
Vector.h File Reference
#include "TypeCast.h"
#include <MRMesh/MRVector.h>

Go to the source code of this file.

Classes

struct  vector_wrapper_base< T >
 
struct  vector_wrapper< T >
 
struct  vector_ref_wrapper< T >
 

Macros

#define MR_VECTOR_LIKE_IMPL(ClassName, Type)
 
#define MR_VECTOR_IMPL(Type)   MR_VECTOR_LIKE_IMPL( MR_CONCAT( Vector, Type ), Type )
 
#define VECTOR_WRAPPER(Type)   vector_wrapper<typename Type::value_type>
 
#define VECTOR_REF_WRAPPER(Type)   vector_ref_wrapper<typename Type::value_type>
 
#define REGISTER_VECTOR_LIKE(ClassName, Type)
 
#define REGISTER_VECTOR(Type)
 
#define VECTOR(...)   vector_ref_wrapper( __VA_ARGS__ )
 
#define NEW_VECTOR(...)   new vector_wrapper( __VA_ARGS__ )
 
#define RETURN_VECTOR(...)   return auto_cast( VECTOR( __VA_ARGS__ ) )
 
#define RETURN_NEW_VECTOR(...)   return auto_cast( NEW_VECTOR( __VA_ARGS__ ) )
 

Macro Definition Documentation

◆ MR_VECTOR_IMPL

#define MR_VECTOR_IMPL ( Type)    MR_VECTOR_LIKE_IMPL( MR_CONCAT( Vector, Type ), Type )

◆ MR_VECTOR_LIKE_IMPL

#define MR_VECTOR_LIKE_IMPL ( ClassName,
Type )
Value:
static_assert( sizeof( MR_CONCAT( MR, ClassName ) ) == sizeof( vector_ref_wrapper<Type> ) ); \
void MR_CONCAT( MR_CONCAT( mr, ClassName ), Invalidate )( MR_CONCAT( MR, ClassName )* vec ) \
{ \
reinterpret_cast<vector_ref_wrapper<Type>*>( vec )->invalidate(); \
} \
void MR_CONCAT( MR_CONCAT( mr, ClassName ), Free )( MR_CONCAT( MR, ClassName )* vec ) \
{ \
delete reinterpret_cast<vector_wrapper<Type>*>( vec ); \
} \
MR_CONCAT( MR, ClassName )* MR_CONCAT( MR_CONCAT( mr, ClassName ), New )(void) \
{ \
return reinterpret_cast<MR_CONCAT( MR, ClassName )*>( new vector_wrapper<Type>( std::vector<Type>() ) ); \
}
#define MR_CONCAT(a, b)
Definition MRMacros.h:17
Definition MRCameraOrientationPlugin.h:8
Definition Vector.h:66
Definition Vector.h:46

◆ NEW_VECTOR

#define NEW_VECTOR ( ...)    new vector_wrapper( __VA_ARGS__ )

◆ REGISTER_VECTOR

#define REGISTER_VECTOR ( Type)
Value:
ADD_AUTO_CAST( VECTOR_REF_WRAPPER( Type ), MR_CONCAT( MR, Type ) ); \
ADD_AUTO_CAST( VECTOR_WRAPPER( Type ), MR_CONCAT( MR, Type ) );
#define ADD_AUTO_CAST(From, To)
helper macro to associate source and target types for auto-casting
Definition TypeCast.h:53
#define VECTOR_WRAPPER(Type)
Definition Vector.h:96
#define VECTOR_REF_WRAPPER(Type)
Definition Vector.h:97

◆ REGISTER_VECTOR_LIKE

#define REGISTER_VECTOR_LIKE ( ClassName,
Type )
Value:
ADD_AUTO_CAST( vector_ref_wrapper<Type>, ClassName ); \
ADD_AUTO_CAST( vector_wrapper<Type>, ClassName );

◆ RETURN_NEW_VECTOR

#define RETURN_NEW_VECTOR ( ...)    return auto_cast( NEW_VECTOR( __VA_ARGS__ ) )

◆ RETURN_VECTOR

#define RETURN_VECTOR ( ...)    return auto_cast( VECTOR( __VA_ARGS__ ) )

◆ VECTOR

#define VECTOR ( ...)    vector_ref_wrapper( __VA_ARGS__ )

◆ VECTOR_REF_WRAPPER

#define VECTOR_REF_WRAPPER ( Type)    vector_ref_wrapper<typename Type::value_type>

◆ VECTOR_WRAPPER

#define VECTOR_WRAPPER ( Type)    vector_wrapper<typename Type::value_type>