NEST  2.6.0,not_revisioned_source_dir@0
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TokenArray Class Reference

#include <tokenarray.h>

Inheritance diagram for TokenArray:
AggregateDatum< TokenArray,&SLIInterpreter::Arraytype >

Classes

class  OutOfRange
 Exception classes. More...
 

Public Member Functions

 TokenArray (void)
 
 TokenArray (size_t n, const Token &t=Token(), size_t alloc=128)
 
 TokenArray (const TokenArray &a)
 
 TokenArray (const TokenArrayObj &a)
 
 TokenArray (const std::vector< size_t > &)
 
 TokenArray (const std::vector< long > &)
 
 TokenArray (const std::valarray< long > &)
 
 TokenArray (const std::valarray< double > &)
 
 TokenArray (const std::valarray< float > &)
 
 TokenArray (const std::vector< double > &)
 
 TokenArray (const std::vector< float > &)
 
virtual ~TokenArray ()
 
Tokenbegin () const
 Return pointer to the first element. More...
 
Tokenend () const
 Return pointer to next to last element. More...
 
size_t size (void) const
 Return number of elements in the array. More...
 
size_t capacity (void) const
 Return maximal number of elements that fit into the container. More...
 
Tokenoperator[] (size_t i)
 
const Tokenoperator[] (size_t i) const
 
const Tokenget (long i) const
 
bool index_is_valid (long i) const
 
void rotate (Token *t1, Token *t2, Token *t3)
 
void rotate (long n)
 
bool shrink (void)
 Reduce allocated space such that size()==capacity(). More...
 
bool reserve (size_t n)
 Reserve space such that after the call the new capacity is n. More...
 
unsigned int references (void)
 
void resize (size_t s, const Token &t=Token())
 Resizes the container to size s. More...
 
void push_back (const Token &t)
 
void push_back (Datum *d)
 
void push_back_move (Token &t)
 
void push_back_dont_clone (Token &t)
 
void assign_move (size_t i, Token &t)
 
void assign_move (TokenArray &a, size_t i, size_t n)
 
void insert_move (size_t i, TokenArray &a)
 
void insert_move (size_t i, Token &t)
 
void replace_move (size_t i, size_t n, TokenArray &a)
 
void append_move (TokenArray &a)
 
void pop_back (void)
 
void clear (void)
 
void erase (void)
 
void erase (Token *from, Token *to)
 
void erase (size_t i, size_t n)
 
void reduce (size_t i, size_t n)
 
void reverse ()
 
void swap (TokenArray &a)
 
const TokenArrayoperator= (const TokenArray &)
 
const TokenArrayoperator= (const std::vector< long > &)
 
const TokenArrayoperator= (const std::vector< double > &)
 
const TokenArrayoperator= (const std::valarray< long > &)
 
const TokenArrayoperator= (const std::valarray< double > &)
 
bool operator== (const TokenArray &a) const
 
bool empty (void) const
 
void info (std::ostream &) const
 
void toVector (std::vector< size_t > &) const
 Fill vectors with homogenous integer and double arrays. More...
 
void toVector (std::vector< long > &) const
 
void toVector (std::vector< double > &) const
 
void toVector (std::vector< std::string > &) const
 
void toValarray (std::valarray< long > &) const
 
void toValarray (std::valarray< double > &) const
 
bool valid (void) const
 

Protected Member Functions

 operator TokenArrayObj () const
 

Private Member Functions

bool clone (void)
 
bool detach (void)
 

Private Attributes

TokenArrayObjdata
 

Friends

class TokenArrayObj
 
class TokenStack
 

Constructor & Destructor Documentation

TokenArray::TokenArray ( void  )
inline
TokenArray::TokenArray ( size_t  n,
const Token t = Token(),
size_t  alloc = 128 
)
inlineexplicit
TokenArray::TokenArray ( const TokenArray a)
inline
TokenArray::TokenArray ( const TokenArrayObj a)
inline
TokenArray::TokenArray ( const std::vector< size_t > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::vector< long > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::valarray< long > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::valarray< double > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::valarray< float > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::vector< double > &  a)

References assert(), and data.

TokenArray::TokenArray ( const std::vector< float > &  a)

References assert(), and data.

virtual TokenArray::~TokenArray ( )
inlinevirtual

Member Function Documentation

void TokenArray::append_move ( TokenArray a)
inline
void TokenArray::assign_move ( size_t  i,
Token t 
)
inline
void TokenArray::assign_move ( TokenArray a,
size_t  i,
size_t  n 
)
inline
Token* TokenArray::begin ( void  ) const
inline
size_t TokenArray::capacity ( void  ) const
inline

Return maximal number of elements that fit into the container.

References TokenArrayObj::capacity(), and data.

void TokenArray::clear ( void  )
inline
bool TokenArray::clone ( void  )
inlineprivate
bool TokenArray::detach ( void  )
inlineprivate
bool TokenArray::empty ( void  ) const
inline

References size().

Token* TokenArray::end ( void  ) const
inline
void TokenArray::erase ( void  )
inline

References begin(), detach(), and end().

Referenced by clear(), and DictionaryStack::toArray().

void TokenArray::erase ( Token from,
Token to 
)
inline
void TokenArray::erase ( size_t  i,
size_t  n 
)
inline
const Token& TokenArray::get ( long  i) const
inline
bool TokenArray::index_is_valid ( long  i) const
inline
void TokenArray::info ( std::ostream &  ) const
void TokenArray::insert_move ( size_t  i,
TokenArray a 
)
inline
void TokenArray::insert_move ( size_t  i,
Token t 
)
inline
TokenArray::operator TokenArrayObj ( ) const
inlineprotected

References data.

const TokenArray & TokenArray::operator= ( const TokenArray a)
const TokenArray& TokenArray::operator= ( const std::vector< long > &  )
const TokenArray& TokenArray::operator= ( const std::vector< double > &  )
const TokenArray& TokenArray::operator= ( const std::valarray< long > &  )
const TokenArray& TokenArray::operator= ( const std::valarray< double > &  )
bool TokenArray::operator== ( const TokenArray a) const
inline

References data.

Token& TokenArray::operator[] ( size_t  i)
inline

References clone(), and data.

const Token& TokenArray::operator[] ( size_t  i) const
inline

References data.

void TokenArray::pop_back ( void  )
inline
void TokenArray::push_back ( const Token t)
inline

References clone(), data, and TokenArrayObj::push_back().

Referenced by __pyx_f_12pynestkernel_python_object_to_datum(), __pyx_pf_12pynestkernel_10NESTEngine_12push_connection_datums(), SLIInterpreter::addlinkeddynmodule(), SLIInterpreter::addmodule(), Get_a_aFunction::execute(), nest::TopologyModule::GetGlobalChildren_i_M_aFunction::execute(), SLIArrayModule::FlattenFunction::execute(), SLIArrayModule::SortFunction::execute(), SLIArrayModule::TransposeFunction::execute(), SLIArrayModule::PartitionFunction::execute(), nest::NestModule::GetNodes_i_D_b_bFunction::execute(), Cva_dFunction::execute(), nest::NestModule::GetLeaves_i_D_bFunction::execute(), nest::NestModule::GetChildren_i_D_bFunction::execute(), ValuesFunction::execute(), SLIArrayModule::AreaFunction::execute(), nest::NestModule::GetStatus_aFunction::execute(), nest::NestModule::Cva_CFunction::execute(), SLIArrayModule::Area2Function::execute(), SLIArrayModule::GaborFunction::execute(), SLIArrayModule::Gauss2dFunction::execute(), PclocksFunction::execute(), nest::Multimeter::Parameters_::get(), nest::correlomatrix_detector::State_::get(), nest::RecordingDevice::Parameters_::get(), nest::Connector< K, ConnectionT >::get_connections(), nest::Connector< 1, ConnectionT >::get_connections(), nest::Connector< K_cutoff, ConnectionT >::get_connections(), nest::RecordablesMap< nest::aeif_cond_alpha_RK5 >::get_list(), nest::ModelsModule::init(), Parser::operator()(), nest::MsgHandler::operator()(), nest::Network::random_divergent_connect(), nest::Multimeter::Parameters_::set(), SLIStartup::SLIStartup(), nest::ConnectionID::to_ArrayDatum(), DictionaryStack::toArray(), and TypeTrie::TypeNode::toTokenArray().

void TokenArray::push_back ( Datum d)
inline
void TokenArray::push_back_dont_clone ( Token t)
inline
void TokenArray::push_back_move ( Token t)
inline
void TokenArray::reduce ( size_t  i,
size_t  n 
)
inline
unsigned int TokenArray::references ( void  )
inline
void TokenArray::replace_move ( size_t  i,
size_t  n,
TokenArray a 
)
inline
bool TokenArray::reserve ( size_t  n)
inline
void TokenArray::resize ( size_t  s,
const Token t = Token() 
)
inline

Resizes the container to size s.

If the new size is larger than the old size, the new space is initialized with t.

References clone(), data, and TokenArrayObj::resize().

void TokenArray::reverse ( )
inline
void TokenArray::rotate ( Token t1,
Token t2,
Token t3 
)
inline
void TokenArray::rotate ( long  n = 1)
inline

References begin(), clone(), end(), and size().

bool TokenArray::shrink ( void  )
inline

Reduce allocated space such that size()==capacity().

Returns true if the array was resized and false otherwhise. If true is returned, all existing pointers into the array are invalidated.

References data, and TokenArrayObj::shrink().

size_t TokenArray::size ( void  ) const
inline

Return number of elements in the array.

References data, and TokenArrayObj::size().

Referenced by __pyx_f_12pynestkernel_sli_array_to_object(), array2vector(), nest::Network::convergent_connect(), nest::AbstractLayer::create_layer(), nest::Network::divergent_connect(), nest::Layer< D >::dump_connections(), empty(), erase(), Get_aFunction::execute(), AddtotrieFunction::execute(), Get_a_aFunction::execute(), SLIArrayModule::IMapFunction::execute(), SLIgraphics::WritePGMFunction::execute(), SLIArrayModule::MapThreadFunction::execute(), SLIArrayModule::IMapThreadFunction::execute(), SLIArrayModule::IMapIndexedFunction::execute(), SLIArrayModule::ArrayloadFunction::execute(), SLIArrayModule::FlattenFunction::execute(), SLIArrayModule::TransposeFunction::execute(), SLIArrayModule::PartitionFunction::execute(), SLIArrayModule::Put_a_a_tFunction::execute(), RestoredstackFunction::execute(), nest::NestModule::GetStatus_aFunction::execute(), Forallindexed_aFunction::execute(), Processes::Sysexec_aFunction::execute(), nest::NestModule::SetStatus_aaFunction::execute(), Search_aFunction::execute(), nest::MsgHandler::get_status(), nest::GIDCollection::GIDCollection(), TypeTrie::newnode(), nest::Scheduler::prepare_nodes(), nest::Network::random_convergent_connect(), nest::Network::random_divergent_connect(), reduce(), reverse(), rotate(), nest::FreeLayer< D >::set_status(), setValue< std::valarray< double > >(), setValue< std::valarray< long > >(), setValue< std::vector< double > >(), setValue< std::vector< long > >(), TypeTrie::TypeNode::toTokenArray(), toValarray(), and toVector().

void TokenArray::swap ( TokenArray a)
inline

References data, and swap().

void TokenArray::toValarray ( std::valarray< long > &  a) const
void TokenArray::toValarray ( std::valarray< double > &  a) const
void TokenArray::toVector ( std::vector< size_t > &  a) const
void TokenArray::toVector ( std::vector< long > &  a) const
void TokenArray::toVector ( std::vector< double > &  a) const
void TokenArray::toVector ( std::vector< std::string > &  a) const
bool TokenArray::valid ( void  ) const

References data, and TokenArrayObj::valid().

Friends And Related Function Documentation

friend class TokenArrayObj
friend

Referenced by clone(), and detach().

friend class TokenStack
friend

Member Data Documentation

TokenArrayObj* TokenArray::data
private

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