Go to the documentation of this file. 1 #ifndef RTABMAP_FLANN_ANY_H_
2 #define RTABMAP_FLANN_ANY_H_
44 virtual void clone(
void*
const* src,
void**
dest) = 0;
45 virtual void move(
void*
const* src,
void**
dest) = 0;
47 virtual const void*
get_value(
void*
const * src) = 0;
49 virtual const std::type_info&
type() = 0;
50 virtual void print(std::ostream&
out,
void*
const* src) = 0;
57 virtual const std::type_info&
type() {
return typeid(
T); }
67 new (
dest)
T(*
reinterpret_cast<T const*
>(src));
71 virtual void*
get_value(
void** src) {
return reinterpret_cast<void*
>(src); }
72 virtual const void*
get_value(
void*
const * src) {
return reinterpret_cast<const void*
>(src); }
73 virtual void print(std::ostream& out,
void*
const* src) { out << *reinterpret_cast<T const*>(src); }
82 delete (*
reinterpret_cast<T**
>(
x));
87 *
dest =
new T(*
reinterpret_cast<T const*
>(src));
91 *
dest =
new T(**
reinterpret_cast<T* const*
>(src));
93 virtual void move(
void*
const* src,
void**
dest)
95 (*
reinterpret_cast<T**
>(
dest))->~T();
96 **
reinterpret_cast<T**
>(
dest) = **
reinterpret_cast<T* const*
>(src);
98 virtual void*
get_value(
void** src) {
return *src; }
99 virtual const void*
get_value(
void*
const * src) {
return *src; }
100 virtual void print(std::ostream& out,
void*
const* src) { out << *reinterpret_cast<T const*>(*src); }
126 #define SMALL_POLICY(TYPE) \
128 struct choose_policy<TYPE> { typedef small_any_policy<TYPE> type; \
163 template <
typename T>
205 template <
typename T>
209 policy = anyimpl::get_policy<T>();
264 policy = anyimpl::get_policy<anyimpl::empty_any>();
280 const std::type_info&
type()
const
285 friend std::ostream&
operator <<(std::ostream& out,
const any& any_val);
296 #endif // FLANN_ANY_H_
std::ostream & operator<<(std::ostream &out, const empty_any &)
base_any_policy * get_policy()
This function will return a different policy for each type.
virtual void clone(void *const *src, void **dest)=0
const std::type_info & type() const
any & swap(any &x)
Utility functions.
virtual void static_delete(void **x)=0
virtual void * get_value(void **src)=0
virtual void * get_value(void **src)
virtual void print(std::ostream &out, void *const *src)=0
virtual void * get_value(void **src)
virtual const std::type_info & type()
virtual void static_delete(void **x)
virtual void clone(void *const *src, void **dest)
SMALL_POLICY(signed char)
virtual void static_delete(void **)
virtual const std::type_info & type()=0
bool compatible(const any &x) const
Returns true if the two types are the same.
virtual void move(void *const *src, void **dest)
virtual void move(void *const *src, void **dest)=0
friend std::ostream & operator<<(std::ostream &out, const any &any_val)
bool has_type()
Returns if the type is compatible with the policy.
virtual void copy_from_value(void const *src, void **dest)
void reset()
Frees any allocated memory, and sets the value to NULL.
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)
any(const any &x)
Copy constructor.
virtual const void * get_value(void *const *src)
std::ofstream out("Result.txt")
anyimpl::base_any_policy * policy
virtual void print(std::ostream &out, void *const *src)
virtual void move(void *const *src, void **dest)
std::ostream & operator<<(std::ostream &out, const any &any_val)
virtual void print(std::ostream &out, void *const *src)
small_any_policy< T * > type
virtual const void * get_value(void *const *src)
T & cast()
Cast operator. You can only cast to the original type.
any & operator=(const char *x)
any & assign(const any &x)
Assignment function from another any.
any_t & operator=(const T &x)
Assignment operator.
const T & cast() const
Cast operator. You can only cast to the original type.
any(const char *x)
Special initializing constructor for string literals.
bool empty() const
Returns true if the any contains no value.
virtual void copy_from_value(void const *src, void **dest)
virtual void copy_from_value(void const *src, void **dest)=0
any(const T &x)
Initializing constructor.
virtual void clone(void *const *src, void **dest)
any_t & assign(const T &x)
Assignment function.
virtual ::size_t get_size()
virtual ::size_t get_size()=0
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:06