LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
ndarray::detail::Core< 0 > Class Template Reference

#include <Core.h>

Public Types

typedef boost::mpl::int_< 0 > ND
 
typedef boost::intrusive_ptr
< Core
Ptr
 
typedef boost::intrusive_ptr
< Core const > 
ConstPtr
 

Public Member Functions

Ptr copy () const
 
int getSize () const
 
int getStride () const
 
template<int M>
int computeOffset (Vector< int, M > const &index) const
 Recursively compute the offset to an element. More...
 
Manager::Ptr getManager () const
 Return the Manager that determines the lifetime of the array data. More...
 
void setManager (Manager::Ptr const &manager)
 Set the Manager that determines the lifetime of the array data. More...
 
template<int M>
void fillShape (Vector< int, M > const &shape) const
 Recursively fill a shape vector. More...
 
template<int M>
void fillStrides (Vector< int, M > const &strides) const
 Recursively fill a strides vector. More...
 
int getNumElements () const
 Recursively determine the total number of elements. More...
 
int getRC () const
 Return the reference count (for debugging purposes). More...
 
bool isUnique () const
 Return true if the Core and Manager reference counts are 1 and the manager is unique. More...
 

Protected Member Functions

virtual ~Core ()
 
template<int M>
 Core (Vector< int, M > const &shape, Vector< int, M > const &strides, Manager::Ptr const &manager)
 
template<int M>
 Core (Vector< int, M > const &shape, Manager::Ptr const &manager)
 
template<int M>
 Core (Vector< int, M > const &shape, int stride, Manager::Ptr const &manager)
 
 Core (Manager::Ptr const &manager)
 
 Core (Core const &other)
 

Private Attributes

Manager::Ptr _manager
 
int _rc
 

Friends

void intrusive_ptr_add_ref (Core const *core)
 
void intrusive_ptr_release (Core const *core)
 

Detailed Description

template<>
class ndarray::detail::Core< 0 >

Definition at line 183 of file Core.h.

Member Typedef Documentation

typedef boost::intrusive_ptr<Core const> ndarray::detail::Core< 0 >::ConstPtr

Definition at line 187 of file Core.h.

typedef boost::mpl::int_<0> ndarray::detail::Core< 0 >::ND

Definition at line 185 of file Core.h.

typedef boost::intrusive_ptr<Core> ndarray::detail::Core< 0 >::Ptr

Definition at line 186 of file Core.h.

Constructor & Destructor Documentation

virtual ndarray::detail::Core< 0 >::~Core ( )
inlineprotectedvirtual

Definition at line 231 of file Core.h.

231 {}
template<int M>
ndarray::detail::Core< 0 >::Core ( Vector< int, M > const &  shape,
Vector< int, M > const &  strides,
Manager::Ptr const &  manager 
)
inlineprotected

Definition at line 234 of file Core.h.

238  : _manager(manager), _rc(1) {}
Manager::Ptr _manager
Definition: Core.h:260
template<int M>
ndarray::detail::Core< 0 >::Core ( Vector< int, M > const &  shape,
Manager::Ptr const &  manager 
)
inlineprotected

Definition at line 241 of file Core.h.

244  : _manager(manager), _rc(1) {}
Manager::Ptr _manager
Definition: Core.h:260
template<int M>
ndarray::detail::Core< 0 >::Core ( Vector< int, M > const &  shape,
int  stride,
Manager::Ptr const &  manager 
)
inlineprotected

Definition at line 247 of file Core.h.

251  : _manager(manager), _rc(1) {}
Manager::Ptr _manager
Definition: Core.h:260
ndarray::detail::Core< 0 >::Core ( Manager::Ptr const &  manager)
inlineprotected

Definition at line 253 of file Core.h.

255  : _manager(manager), _rc(1) {}
Manager::Ptr _manager
Definition: Core.h:260
ndarray::detail::Core< 0 >::Core ( Core< 0 > const &  other)
inlineprotected

Definition at line 257 of file Core.h.

257 : _manager(other._manager), _rc(1) {}
Manager::Ptr _manager
Definition: Core.h:260

Member Function Documentation

template<int M>
int ndarray::detail::Core< 0 >::computeOffset ( Vector< int, M > const &  index) const
inline

Recursively compute the offset to an element.

Definition at line 204 of file Core.h.

204 { return 0; }
Ptr ndarray::detail::Core< 0 >::copy ( ) const
inline

Definition at line 197 of file Core.h.

197 { return Ptr(new Core(*this)); }
boost::intrusive_ptr< Core > Ptr
Definition: Core.h:186
Core(Vector< int, M > const &shape, Vector< int, M > const &strides, Manager::Ptr const &manager)
Definition: Core.h:234
template<int M>
void ndarray::detail::Core< 0 >::fillShape ( Vector< int, M > const &  shape) const
inline

Recursively fill a shape vector.

Definition at line 214 of file Core.h.

214 {}
template<int M>
void ndarray::detail::Core< 0 >::fillStrides ( Vector< int, M > const &  strides) const
inline

Recursively fill a strides vector.

Definition at line 218 of file Core.h.

218 {}
Manager::Ptr ndarray::detail::Core< 0 >::getManager ( ) const
inline

Return the Manager that determines the lifetime of the array data.

Definition at line 207 of file Core.h.

207 { return _manager; }
Manager::Ptr _manager
Definition: Core.h:260
int ndarray::detail::Core< 0 >::getNumElements ( ) const
inline

Recursively determine the total number of elements.

Definition at line 221 of file Core.h.

221 { return 1; }
int ndarray::detail::Core< 0 >::getRC ( ) const
inline

Return the reference count (for debugging purposes).

Definition at line 224 of file Core.h.

224 { return _rc; }
int ndarray::detail::Core< 0 >::getSize ( ) const
inline

Definition at line 199 of file Core.h.

199 { return 1; }
int ndarray::detail::Core< 0 >::getStride ( ) const
inline

Definition at line 200 of file Core.h.

200 { return 1; }
bool ndarray::detail::Core< 0 >::isUnique ( ) const
inline

Return true if the Core and Manager reference counts are 1 and the manager is unique.

Definition at line 227 of file Core.h.

227 { return (_rc == 1) && (_manager->getRC() == 1) && _manager->isUnique(); }
Manager::Ptr _manager
Definition: Core.h:260
void ndarray::detail::Core< 0 >::setManager ( Manager::Ptr const &  manager)
inline

Set the Manager that determines the lifetime of the array data.

Definition at line 210 of file Core.h.

210 { _manager = manager; }
Manager::Ptr _manager
Definition: Core.h:260

Friends And Related Function Documentation

void intrusive_ptr_add_ref ( Core< 0 > const *  core)
friend

Definition at line 189 of file Core.h.

189  {
190  ++core->_rc;
191  }
void intrusive_ptr_release ( Core< 0 > const *  core)
friend

Definition at line 193 of file Core.h.

193  {
194  if ((--core->_rc)==0) delete core;
195  }

Member Data Documentation

Manager::Ptr ndarray::detail::Core< 0 >::_manager
private

Definition at line 260 of file Core.h.

int ndarray::detail::Core< 0 >::_rc
mutableprivate

Definition at line 261 of file Core.h.


The documentation for this class was generated from the following file: