* in bytes consumed by a @p{bool}
* variable.
*/
+ inline
unsigned int memory_consumption (const bool);
/**
* in bytes consumed by a @p{char}
* variable.
*/
+ inline
unsigned int memory_consumption (const char);
/**
* in bytes consumed by a
* @p{short int} variable.
*/
+ inline
unsigned int memory_consumption (const short int);
/**
* in bytes consumed by a
* @p{short unsigned int} variable.
*/
+ inline
unsigned int memory_consumption (const short unsigned int);
/**
* in bytes consumed by a @p{int}
* variable.
*/
+ inline
unsigned int memory_consumption (const int);
/**
* in bytes consumed by a @p{unsigned int}
* variable.
*/
+ inline
unsigned int memory_consumption (const unsigned int);
/**
* in bytes consumed by a @p{float}
* variable.
*/
+ inline
unsigned int memory_consumption (const float);
/**
* in bytes consumed by a @p{double}
* variable.
*/
+ inline
unsigned int memory_consumption (const double);
/**
* consumed by a @p{std::string}
* variable.
*/
+ inline
unsigned int memory_consumption (const std::string &s);
/**
* vectors of bools.
*/
template <typename T>
+ inline
unsigned int memory_consumption (const typename std::vector<T> &v);
/**
* elements.
*/
template <typename T, int N>
+ inline
unsigned int memory_consumption (const T (&v)[N]);
/**
* one-by-one, but as a bit
* field.
*/
+ inline
unsigned int memory_consumption (const std::vector<bool> &v);
/**
* consumption of a vector, here
* for a vector of @p{int}s.
*/
+ inline
unsigned int memory_consumption (const std::vector<int> &v);
/**
* consumption of a vector, here
* for a vector of @p{double}s.
*/
+ inline
unsigned int memory_consumption (const std::vector<double> &v);
/**
* consumption of a vector, here
* for a vector of @p{float}s.
*/
+ inline
unsigned int memory_consumption (const std::vector<float> &v);
/**
* consumption of a vector, here
* for a vector of @p{char}s.
*/
+ inline
unsigned int memory_consumption (const std::vector<char> &v);
/**
* consumption of a vector, here
* for a vector of @p{unsigned char}s.
*/
+ inline
unsigned int memory_consumption (const std::vector<unsigned char> &v);
/**
* for a vector of pointers.
*/
template <typename T>
+ inline
unsigned int memory_consumption (const typename std::vector<T *> &v);
/**
* consumption of a vector, here
* for a vector of strings. This
* function is not necessary from a
- * struct C++ viewpoint, since it
+ * strict C++ viewpoint, since it
* could be generated, but is
* necessary for compatibility with
* IBM's xlC 5.0 compiler, and
* consumed by a pair of values.
*/
template <typename A, typename B>
+ inline
unsigned int memory_consumption (const typename std::pair<A,B> &p);
/**
* pointed to.
*/
template <typename T>
+ inline
unsigned int memory_consumption (const T * const);
/**
* pointers
*/
template <typename T>
+ inline
unsigned int memory_consumption (T * const);
/**
* @p{T*} template function
* above.
*/
+ inline
unsigned int memory_consumption (void * const);
* does not work.
*/
template <typename T>
+ inline
unsigned int memory_consumption (const T &t);
}
mem += memory_consumption(v[i]);
mem += (v.capacity() - n)*sizeof(T);
return mem;
- };
+ }
for (unsigned int i=0; i<N; ++i)
mem += memory_consumption(v[i]);
return mem;
- };
+ }
unsigned int memory_consumption (const std::vector<bool> &v)
{
return v.capacity() / 8 + sizeof(v);
- };
+ }
{
return (v.capacity() * sizeof(int) +
sizeof(v));
- };
+ }
{
return (v.capacity() * sizeof(double) +
sizeof(v));
- };
+ }
{
return (v.capacity() * sizeof(float) +
sizeof(v));
- };
+ }
{
return (v.capacity() * sizeof(char) +
sizeof(v));
- };
+ }
{
return (v.capacity() * sizeof(unsigned char) +
sizeof(v));
- };
+ }
{
return (v.capacity() * sizeof(T *) +
sizeof(v));
- };
+ }
{
return (memory_consumption(p.first) +
memory_consumption(p.second));
- };
+ }
memory_consumption (const T * const)
{
return sizeof(T*);
- };
+ }
memory_consumption (T * const)
{
return sizeof(T*);
- };
+ }
memory_consumption (void * const)
{
return sizeof(void*);
- };
+ }
memory_consumption (const T &t)
{
return t.memory_consumption();
- };
+ }
}
* This function exists once for
* each number of parameters.
*/
+ inline
FunData0<void>::ArgCollector
encapsulate (void (*fun_ptr)());
* each number of parameters.
*/
template <typename Arg1>
+ inline
typename FunData1<Arg1,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1));
* each number of parameters.
*/
template <typename Arg1, typename Arg2>
+ inline
typename FunData2<Arg1,Arg2,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3>
+ inline
typename FunData3<Arg1,Arg2,Arg3,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ inline
typename FunData4<Arg1,Arg2,Arg3,Arg4,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
+ inline
typename FunData5<Arg1,Arg2,Arg3,Arg4,Arg5,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6>
+ inline
typename FunData6<Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7>
+ inline
typename FunData7<Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7, typename Arg8>
+ inline
typename FunData8<Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7, typename Arg8, typename Arg9>
+ inline
typename FunData9<Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8,Arg9,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9));
* each number of parameters.
*/
template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7, typename Arg8, typename Arg9, typename Arg10>
+ inline
typename FunData10<Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8,Arg9,Arg10,void>::ArgCollector
encapsulate (void (*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10));
* each number of parameters.
*/
template <class Class>
+ inline
typename MemFunData0<Class,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)());
* each number of parameters.
*/
template <class Class, typename Arg1>
+ inline
typename MemFunData1<Class,Arg1,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2>
+ inline
typename MemFunData2<Class,Arg1,Arg2,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2, typename Arg3>
+ inline
typename MemFunData3<Class,Arg1,Arg2,Arg3,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2, Arg3));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
+ inline
typename MemFunData4<Class,Arg1,Arg2,Arg3,Arg4,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2, Arg3, Arg4));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
+ inline
typename MemFunData5<Class,Arg1,Arg2,Arg3,Arg4,Arg5,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6>
+ inline
typename MemFunData6<Class,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6));
* each number of parameters.
*/
template <class Class, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6, typename Arg7>
+ inline
typename MemFunData7<Class,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,void>::ArgCollector
encapsulate (void (Class::*fun_ptr)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7));