#include <ArrayPolicies.hpp>
Static Public Member Functions |
static void | Initialize (ObjectType *data, unsigned int itemsToCreate) |
| Initalize each element in the array with ObjectType's default constructor.
|
static void | Initialize (ObjectType *data, unsigned int itemsToCreate, const ObjectType &initValue) |
| Initalize each element in the array with ObjectType's copy constructor.
|
static void | Initialize (ObjectType *data, unsigned int itemsToCreate, const ObjectType *initValue) |
Detailed Description
template<typename ObjectType>
class Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >
Definition at line 84 of file ArrayPolicies.hpp.
Member Function Documentation
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::CopyConstructionFromArray |
( |
ObjectType * |
element, |
|
|
const ObjectType *& |
rhs |
|
) |
| |
|
inlinestaticprivate |
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::CopyConstructionWithPlacementNew |
( |
ObjectType * |
element, |
|
|
const ObjectType & |
initValue |
|
) |
| |
|
inlinestaticprivate |
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::DefaultConstructionWithPlacementNew |
( |
ObjectType * |
element | ) |
|
|
inlinestaticprivate |
template<typename ObjectType >
template<typename CreateType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::DoInitialization |
( |
ObjectType * |
data, |
|
|
unsigned int |
itemsToCreate, |
|
|
const CreateType & |
f |
|
) |
| |
|
inlinestaticprivate |
Definition at line 115 of file ArrayPolicies.hpp.
{
unsigned int nextObjectToCreate = 0;
try
{
for(unsigned int i = 0; i < itemsToCreate; ++i)
{
ObjectType* memLocation = &data[i];
f(memLocation);
++nextObjectToCreate;
}
}
catch(...)
{
for(unsigned int i = 0; i < nextObjectToCreate; ++i)
{
ObjectType* memLocation = &data[nextObjectToCreate - i - 1];
memLocation->~ObjectType();
}
throw;
}
}
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::Initialize |
( |
ObjectType * |
data, |
|
|
unsigned int |
itemsToCreate |
|
) |
| |
|
inlinestatic |
Initalize each element in the array with ObjectType's default constructor.
- Parameters
-
data | The array of values to populate. |
itemsToCreate | The size of data. |
Definition at line 91 of file ArrayPolicies.hpp.
{
boost::bind(&ArrayInitializationPolicy<ObjectType>::DefaultConstructionWithPlacementNew, _1));
}
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::Initialize |
( |
ObjectType * |
data, |
|
|
unsigned int |
itemsToCreate, |
|
|
const ObjectType & |
initValue |
|
) |
| |
|
inlinestatic |
Initalize each element in the array with ObjectType's copy constructor.
- Parameters
-
data | The array of values to populate. |
itemsToCreate | The size of data. |
initValue | The inital value each element in data will have. |
Definition at line 101 of file ArrayPolicies.hpp.
{
boost::bind(&ArrayInitializationPolicy<ObjectType>::CopyConstructionWithPlacementNew, _1, boost::ref(initValue)));
}
template<typename ObjectType >
static void Nektar::ArrayInitializationPolicy< ObjectType, typename boost::disable_if< boost::is_fundamental< ObjectType > >::type >::Initialize |
( |
ObjectType * |
data, |
|
|
unsigned int |
itemsToCreate, |
|
|
const ObjectType * |
initValue |
|
) |
| |
|
inlinestatic |
Definition at line 107 of file ArrayPolicies.hpp.
{
boost::bind(&ArrayInitializationPolicy<ObjectType>::CopyConstructionFromArray, _1, boost::ref(initValue)));
}