40 #ifndef CERES_PUBLIC_INTERNAL_MANUAL_CONSTRUCTOR_H_ 41 #define CERES_PUBLIC_INTERNAL_MANUAL_CONSTRUCTOR_H_ 50 #ifndef CERES_ALIGNED_CHAR_ARRAY 55 template<
int alignment,
int size>
struct AlignType { };
58 #if !defined(CERES_ALIGN_ATTRIBUTE) 59 #define CERES_ALIGNED_CHAR_ARRAY you_must_define_CERES_ALIGNED_CHAR_ARRAY_for_your_compiler 60 #else // !defined(CERES_ALIGN_ATTRIBUTE) 62 #define CERES_ALIGN_TYPE_TEMPLATE(X) \ 63 template<int size> struct AlignType<X, size> { \ 64 typedef CERES_ALIGN_ATTRIBUTE(X) char result[size]; \ 67 CERES_ALIGN_TYPE_TEMPLATE(1);
68 CERES_ALIGN_TYPE_TEMPLATE(2);
69 CERES_ALIGN_TYPE_TEMPLATE(4);
70 CERES_ALIGN_TYPE_TEMPLATE(8);
71 CERES_ALIGN_TYPE_TEMPLATE(16);
72 CERES_ALIGN_TYPE_TEMPLATE(32);
73 CERES_ALIGN_TYPE_TEMPLATE(64);
74 CERES_ALIGN_TYPE_TEMPLATE(128);
75 CERES_ALIGN_TYPE_TEMPLATE(256);
76 CERES_ALIGN_TYPE_TEMPLATE(512);
77 CERES_ALIGN_TYPE_TEMPLATE(1024);
78 CERES_ALIGN_TYPE_TEMPLATE(2048);
79 CERES_ALIGN_TYPE_TEMPLATE(4096);
80 CERES_ALIGN_TYPE_TEMPLATE(8192);
83 #undef CERES_ALIGN_TYPE_TEMPLATE 85 #define CERES_ALIGNED_CHAR_ARRAY(T, Size) \ 86 typename AlignType<CERES_ALIGN_OF(T), sizeof(T) * Size>::result 88 #endif // !defined(CERES_ALIGN_ATTRIBUTE) 90 #endif // CERES_ALIGNED_CHAR_ARRAY 92 template <
typename Type>
101 return reinterpret_cast<Type*
>(space_);
103 inline const Type*
get()
const {
104 return reinterpret_cast<const Type*
>(space_);
115 return reinterpret_cast<void*
>(space_);
123 template <
typename T1>
125 new(space())
Type(p1);
128 template <
typename T1,
typename T2>
130 new(space())
Type(p1, p2);
133 template <
typename T1,
typename T2,
typename T3>
135 new(space())
Type(p1, p2, p3);
138 template <
typename T1,
typename T2,
typename T3,
typename T4>
140 new(space())
Type(p1, p2, p3, p4);
143 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
146 new(space())
Type(p1, p2, p3, p4, p5);
149 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
152 const T5&
p5,
const T6& p6) {
153 new(space())
Type(p1, p2, p3, p4, p5, p6);
156 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
157 typename T6,
typename T7>
159 const T5&
p5,
const T6& p6,
const T7& p7) {
160 new(space())
Type(p1, p2, p3, p4, p5, p6, p7);
163 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
164 typename T6,
typename T7,
typename T8>
166 const T5&
p5,
const T6& p6,
const T7& p7,
const T8& p8) {
167 new(space())
Type(p1, p2, p3, p4, p5, p6, p7, p8);
170 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
171 typename T6,
typename T7,
typename T8,
typename T9>
173 const T5&
p5,
const T6& p6,
const T7& p7,
const T8& p8,
175 new(space())
Type(p1, p2, p3, p4, p5, p6, p7, p8, p9);
178 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
179 typename T6,
typename T7,
typename T8,
typename T9,
typename T10>
181 const T5&
p5,
const T6& p6,
const T7& p7,
const T8& p8,
182 const T9& p9,
const T10& p10) {
183 new(space())
Type(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
186 template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
187 typename T6,
typename T7,
typename T8,
typename T9,
typename T10,
190 const T5&
p5,
const T6& p6,
const T7& p7,
const T8& p8,
191 const T9& p9,
const T10& p10,
const T11& p11) {
192 new(space())
Type(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
203 #undef CERES_ALIGNED_CHAR_ARRAY 208 #endif // CERES_PUBLIC_INTERNAL_MANUAL_CONSTRUCTOR_H_
const Type & operator*() const
static const Pose3 T3(Rot3::Rodrigues(-90, 0, 0), Point3(1, 2, 3))
Pose2 T2(M_PI/2.0, Point2(0.0, 2.0))
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10, const T11 &p11)
const Type * operator->() const
static const Similarity3 T4(R, P, s)
void Init(const T1 &p1, const T2 &p2, const T3 &p3)
void Init(const T1 &p1, const T2 &p2)
#define CERES_ALIGNED_CHAR_ARRAY
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8)
static const Similarity3 T6(Rot3(), Point3(1, 1, 0), 2)
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4)
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9, const T10 &p10)
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7)
static const Similarity3 T5(R, P, 10)
Pose2 T1(M_PI/4.0, Point2(sqrt(0.5), sqrt(0.5)))
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6)
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6, const T7 &p7, const T8 &p8, const T9 &p9)
void Init(const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5)