Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
boost::python::detail::container_element< Container, Index, Policies > Class Template Reference

#include <indexing_suite_detail.hpp>

Public Types

typedef Index index_type
 
typedef Container container_type
 
typedef Policies::data_type element_type
 
typedef Policies policies_type
 
typedef container_element
< Container, Index, Policies > 
self_t
 
typedef proxy_group< self_tlinks_type
 
typedef Index index_type
 
typedef Container container_type
 
typedef Policies::data_type element_type
 
typedef Policies policies_type
 
typedef container_element
< Container, Index, Policies > 
self_t
 
typedef proxy_group< self_tlinks_type
 

Public Member Functions

 container_element (object container, Index index)
 
 container_element (container_element const &ce)
 
 ~container_element ()
 
element_typeoperator* () const
 
element_typeget () const
 
void detach ()
 
bool is_detached () const
 
Container & get_container () const
 
Index get_index () const
 
void set_index (Index i)
 
 container_element (object container, Index index)
 
 container_element (container_element const &ce)
 
 ~container_element ()
 
element_typeoperator* () const
 
element_typeget () const
 
void detach ()
 
bool is_detached () const
 
Container & get_container () const
 
Index get_index () const
 
void set_index (Index i)
 

Static Public Member Functions

static proxy_links< self_t,
Container > & 
get_links ()
 
static proxy_links< self_t,
Container > & 
get_links ()
 

Detailed Description

template<class Container, class Index, class Policies>
class boost::python::detail::container_element< Container, Index, Policies >

Definition at line 352 of file indexing_suite_detail.hpp.

Member Typedef Documentation

template<class Container, class Index, class Policies>
typedef Container boost::python::detail::container_element< Container, Index, Policies >::container_type

Definition at line 357 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Container boost::python::detail::container_element< Container, Index, Policies >::container_type

Definition at line 357 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Policies::data_type boost::python::detail::container_element< Container, Index, Policies >::element_type

Definition at line 358 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Policies::data_type boost::python::detail::container_element< Container, Index, Policies >::element_type

Definition at line 358 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Index boost::python::detail::container_element< Container, Index, Policies >::index_type

Definition at line 356 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Index boost::python::detail::container_element< Container, Index, Policies >::index_type

Definition at line 356 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef proxy_group<self_t> boost::python::detail::container_element< Container, Index, Policies >::links_type

Definition at line 361 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef proxy_group<self_t> boost::python::detail::container_element< Container, Index, Policies >::links_type

Definition at line 361 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Policies boost::python::detail::container_element< Container, Index, Policies >::policies_type

Definition at line 359 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef Policies boost::python::detail::container_element< Container, Index, Policies >::policies_type

Definition at line 359 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef container_element<Container, Index, Policies> boost::python::detail::container_element< Container, Index, Policies >::self_t

Definition at line 360 of file indexing_suite_detail.hpp.

template<class Container, class Index, class Policies>
typedef container_element<Container, Index, Policies> boost::python::detail::container_element< Container, Index, Policies >::self_t

Definition at line 360 of file indexing_suite_detail.hpp.

Constructor & Destructor Documentation

template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::container_element ( object  container,
Index  index 
)
inline

Definition at line 363 of file indexing_suite_detail.hpp.

364  : ptr()
365  , container(container)
366  , index(index)
367  {
368  }
template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::container_element ( container_element< Container, Index, Policies > const &  ce)
inline

Definition at line 370 of file indexing_suite_detail.hpp.

371  : ptr(ce.ptr.get() == 0 ? 0 : new element_type(*ce.ptr.get()))
372  , container(ce.container)
373  , index(ce.index)
374  {
375  }
template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::~container_element ( )
inline

Definition at line 377 of file indexing_suite_detail.hpp.

378  {
379  if (!is_detached())
380  get_links().remove(*this);
381  }
static proxy_links< self_t, Container > & get_links()

Here is the call graph for this function:

template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::container_element ( object  container,
Index  index 
)
inline

Definition at line 363 of file indexing_suite_detail.hpp.

364  : ptr()
365  , container(container)
366  , index(index)
367  {
368  }
template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::container_element ( container_element< Container, Index, Policies > const &  ce)
inline

Definition at line 370 of file indexing_suite_detail.hpp.

371  : ptr(ce.ptr.get() == 0 ? 0 : new element_type(*ce.ptr.get()))
372  , container(ce.container)
373  , index(ce.index)
374  {
375  }
template<class Container, class Index, class Policies>
boost::python::detail::container_element< Container, Index, Policies >::~container_element ( )
inline

Definition at line 377 of file indexing_suite_detail.hpp.

378  {
379  if (!is_detached())
380  get_links().remove(*this);
381  }
static proxy_links< self_t, Container > & get_links()

Here is the call graph for this function:

Member Function Documentation

template<class Container, class Index, class Policies>
void boost::python::detail::container_element< Container, Index, Policies >::detach ( )
inline

Definition at line 398 of file indexing_suite_detail.hpp.

399  {
400  if (!is_detached())
401  {
402  ptr.reset(
403  new element_type(
404  Policies::get_item(get_container(), index)));
405  container = object(); // free container. reset it to None
406  }
407  }

Here is the call graph for this function:

template<class Container, class Index, class Policies>
void boost::python::detail::container_element< Container, Index, Policies >::detach ( )
inline

Definition at line 398 of file indexing_suite_detail.hpp.

399  {
400  if (!is_detached())
401  {
402  ptr.reset(
403  new element_type(
404  Policies::get_item(get_container(), index)));
405  container = object(); // free container. reset it to None
406  }
407  }

Here is the call graph for this function:

template<class Container, class Index, class Policies>
element_type* boost::python::detail::container_element< Container, Index, Policies >::get ( ) const
inline

Definition at line 390 of file indexing_suite_detail.hpp.

391  {
392  if (is_detached())
393  return get_pointer(ptr);
394  return &Policies::get_item(get_container(), index);
395  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

template<class Container, class Index, class Policies>
element_type* boost::python::detail::container_element< Container, Index, Policies >::get ( ) const
inline

Definition at line 390 of file indexing_suite_detail.hpp.

391  {
392  if (is_detached())
393  return get_pointer(ptr);
394  return &Policies::get_item(get_container(), index);
395  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container, class Index, class Policies>
Container& boost::python::detail::container_element< Container, Index, Policies >::get_container ( ) const
inline

Definition at line 416 of file indexing_suite_detail.hpp.

417  {
418  return extract<Container&>(container)();
419  }

Here is the caller graph for this function:

template<class Container, class Index, class Policies>
Container& boost::python::detail::container_element< Container, Index, Policies >::get_container ( ) const
inline

Definition at line 416 of file indexing_suite_detail.hpp.

417  {
418  return extract<Container&>(container)();
419  }
template<class Container, class Index, class Policies>
Index boost::python::detail::container_element< Container, Index, Policies >::get_index ( ) const
inline

Definition at line 422 of file indexing_suite_detail.hpp.

423  {
424  return index;
425  }
template<class Container, class Index, class Policies>
Index boost::python::detail::container_element< Container, Index, Policies >::get_index ( ) const
inline

Definition at line 422 of file indexing_suite_detail.hpp.

423  {
424  return index;
425  }
template<class Container, class Index, class Policies>
static proxy_links<self_t, Container>& boost::python::detail::container_element< Container, Index, Policies >::get_links ( )
inlinestatic

Definition at line 434 of file indexing_suite_detail.hpp.

435  {
436  // All container_element(s) maintain links to
437  // its container in a global map (see proxy_links).
438  // This global "links" map is a singleton.
439 
440  static proxy_links<self_t, Container> links;
441  return links; // singleton
442  }

Here is the caller graph for this function:

template<class Container, class Index, class Policies>
static proxy_links<self_t, Container>& boost::python::detail::container_element< Container, Index, Policies >::get_links ( )
inlinestatic

Definition at line 434 of file indexing_suite_detail.hpp.

435  {
436  // All container_element(s) maintain links to
437  // its container in a global map (see proxy_links).
438  // This global "links" map is a singleton.
439 
440  static proxy_links<self_t, Container> links;
441  return links; // singleton
442  }
template<class Container, class Index, class Policies>
bool boost::python::detail::container_element< Container, Index, Policies >::is_detached ( ) const
inline

Definition at line 410 of file indexing_suite_detail.hpp.

411  {
412  return get_pointer(ptr) != 0;
413  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container, class Index, class Policies>
bool boost::python::detail::container_element< Container, Index, Policies >::is_detached ( ) const
inline

Definition at line 410 of file indexing_suite_detail.hpp.

411  {
412  return get_pointer(ptr) != 0;
413  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

template<class Container, class Index, class Policies>
element_type& boost::python::detail::container_element< Container, Index, Policies >::operator* ( ) const
inline

Definition at line 383 of file indexing_suite_detail.hpp.

384  {
385  if (is_detached())
386  return *get_pointer(ptr);
387  return Policies::get_item(get_container(), index);
388  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

template<class Container, class Index, class Policies>
element_type& boost::python::detail::container_element< Container, Index, Policies >::operator* ( ) const
inline

Definition at line 383 of file indexing_suite_detail.hpp.

384  {
385  if (is_detached())
386  return *get_pointer(ptr);
387  return Policies::get_item(get_container(), index);
388  }
Policies::data_type * get_pointer(python::detail::container_element< Container, Index, Policies > const &p)

Here is the call graph for this function:

template<class Container, class Index, class Policies>
void boost::python::detail::container_element< Container, Index, Policies >::set_index ( Index  i)
inline

Definition at line 428 of file indexing_suite_detail.hpp.

429  {
430  index = i;
431  }
template<class Container, class Index, class Policies>
void boost::python::detail::container_element< Container, Index, Policies >::set_index ( Index  i)
inline

Definition at line 428 of file indexing_suite_detail.hpp.

429  {
430  index = i;
431  }

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