DART  6.10.1
Memory.hpp File Reference
#include <map>
#include <memory>
#include <vector>
#include "dart/common/Deprecated.hpp"
#include "dart/common/detail/AlignedAllocator.hpp"
#include "dart/config.hpp"
#include "dart/common/detail/Memory-impl.hpp"

Go to the source code of this file.

Namespaces

 dart
 
 dart::common
 

Macros

#define DART_RAW_PTR_CREATOR_NAME   create
 
#define DART_SHARED_PTR_CREATOR_NAME   createShared
 
#define DART_UNIQUE_PTR_CREATOR_NAME   createUnique
 
#define _DART_DEFINE_OBJECT_CREATOR(class_name, func_name, ptr_type, creator)
 
#define _DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR( class_name, func_name, ptr_type, creator)
 
#define DART_DEFINE_RAW_OBJECT_CREATOR(class_name)
 
#define DART_DEFINE_SHARED_OBJECT_CREATOR(class_name)
 
#define DART_DEFINE_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR(class_name)
 
#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR(class_name)
 
#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR( class_name)
 
#define DART_DEFINE_UNIQUE_OBJECT_CREATOR(class_name)
 
#define DART_DEFINE_UNIQUE_OBJECT_CREATOR_FOR_PROTECTED_CTOR(class_name)
 
#define DART_DEFINE_OBJECT_CREATORS(class_name)
 
#define DART_DEFINE_OBJECT_CREATORS_FOR_PROTECTED_CTOR(X)
 
#define DART_DEFINE_ALIGNED_OBJECT_CREATORS(class_name)    DART_DEFINE_OBJECT_CREATORS(class_name)
 
#define DART_DEFINE_ALIGNED_OBJECT_CREATORS_FOR_PROTECTED_CTOR(class_name)    DART_DEFINE_OBJECT_CREATORS_FOR_PROTECTED_CTOR(class_name)
 

Typedefs

template<typename _Tp >
using dart::common::aligned_vector = std::vector< _Tp, Eigen::aligned_allocator< _Tp > >
 
template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>>
using dart::common::aligned_map = std::map< _Key, _Tp, _Compare, Eigen::aligned_allocator< std::pair< const _Key, _Tp > >>
 

Functions

template<typename _Tp , typename... _Args>
std::shared_ptr< _Tp > dart::common::make_aligned_shared (_Args &&... __args)
 
template<typename T , typename... Args>
std::unique_ptr< T > dart::common::make_unique (Args &&... args)
 

Macro Definition Documentation

◆ _DART_DEFINE_OBJECT_CREATOR

#define _DART_DEFINE_OBJECT_CREATOR (   class_name,
  func_name,
  ptr_type,
  creator 
)
Value:
template <typename... Args> \
static ptr_type<class_name> func_name(Args&&... args) \
{ \
return creator<class_name>(std::forward<Args>(args)...); \
}

◆ _DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR

#define _DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR (   class_name,
  func_name,
  ptr_type,
  creator 
)
Value:
private: \
struct private_structure \
{ \
explicit private_structure() \
{ \
} \
}; \
\
public: \
template <typename... Args> \
class_name(const private_structure&, Args&&... args) \
: class_name(std::forward<Args>(args)...) \
{ \
} \
template <typename... Args> \
static ptr_type<class_name> func_name(Args&&... args) \
{ \
return creator<class_name>( \
private_structure{}, std::forward<Args>(args)...); \
}

◆ DART_DEFINE_ALIGNED_OBJECT_CREATORS

#define DART_DEFINE_ALIGNED_OBJECT_CREATORS (   class_name)     DART_DEFINE_OBJECT_CREATORS(class_name)

◆ DART_DEFINE_ALIGNED_OBJECT_CREATORS_FOR_PROTECTED_CTOR

#define DART_DEFINE_ALIGNED_OBJECT_CREATORS_FOR_PROTECTED_CTOR (   class_name)     DART_DEFINE_OBJECT_CREATORS_FOR_PROTECTED_CTOR(class_name)

◆ DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR

#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR (   class_name)
Value:
\
_DART_DEFINE_OBJECT_CREATOR( \
class_name, \
std::shared_ptr, \
#define DART_SHARED_PTR_CREATOR_NAME
Definition: Memory.hpp:86
std::shared_ptr< _Tp > make_aligned_shared(_Args &&... __args)
Definition: Memory-impl.hpp:51

◆ DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR

#define DART_DEFINE_ALIGNED_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR (   class_name)
Value:
\
_DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR( \
class_name, \
std::shared_ptr, \

◆ DART_DEFINE_OBJECT_CREATORS

#define DART_DEFINE_OBJECT_CREATORS (   class_name)
Value:
DART_DEFINE_UNIQUE_OBJECT_CREATOR(class_name)
#define DART_DEFINE_SHARED_OBJECT_CREATOR(class_name)
Definition: Memory.hpp:133

◆ DART_DEFINE_OBJECT_CREATORS_FOR_PROTECTED_CTOR

#define DART_DEFINE_OBJECT_CREATORS_FOR_PROTECTED_CTOR (   X)
Value:
DART_DEFINE_UNIQUE_OBJECT_CREATOR_FOR_PROTECTED_CTOR(X)
#define DART_DEFINE_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR(class_name)
Definition: Memory.hpp:144

◆ DART_DEFINE_RAW_OBJECT_CREATOR

#define DART_DEFINE_RAW_OBJECT_CREATOR (   class_name)
Value:
template <typename... Args> \
static class_name* DART_RAW_PTR_CREATOR_NAME(Args&&... args) \
{ \
return new class_name(std::forward<Args>(args)...); \
}
#define DART_RAW_PTR_CREATOR_NAME
Definition: Memory.hpp:85

◆ DART_DEFINE_SHARED_OBJECT_CREATOR

#define DART_DEFINE_SHARED_OBJECT_CREATOR (   class_name)
Value:
\
_DART_DEFINE_OBJECT_CREATOR( \
class_name, \
std::shared_ptr, \
std::make_shared)

◆ DART_DEFINE_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR

#define DART_DEFINE_SHARED_OBJECT_CREATOR_FOR_PROTECTED_CTOR (   class_name)
Value:
\
_DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR( \
class_name, \
std::shared_ptr, \
std::make_shared)

◆ DART_DEFINE_UNIQUE_OBJECT_CREATOR

#define DART_DEFINE_UNIQUE_OBJECT_CREATOR (   class_name)
Value:
duke \
_DART_DEFINE_OBJECT_CREATOR( \
class_name, \
std::unique_ptr, \
#define DART_UNIQUE_PTR_CREATOR_NAME
Definition: Memory.hpp:87
std::unique_ptr< T > make_unique(Args &&... args)
Definition: Memory-impl.hpp:67

◆ DART_DEFINE_UNIQUE_OBJECT_CREATOR_FOR_PROTECTED_CTOR

#define DART_DEFINE_UNIQUE_OBJECT_CREATOR_FOR_PROTECTED_CTOR (   class_name)
Value:
\
_DART_DEFINE_OBJECT_CREATOR_FOR_PROTECTED_CTOR( \
class_name, \
std::unique_ptr, \

◆ DART_RAW_PTR_CREATOR_NAME

#define DART_RAW_PTR_CREATOR_NAME   create

◆ DART_SHARED_PTR_CREATOR_NAME

#define DART_SHARED_PTR_CREATOR_NAME   createShared

◆ DART_UNIQUE_PTR_CREATOR_NAME

#define DART_UNIQUE_PTR_CREATOR_NAME   createUnique