Public Types | Public Member Functions | Private Member Functions | Private Attributes

Octave_map Class Reference

#include "oct-map.h"

Collaboration diagram for Octave_map:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map< std::string,
Cell >::const_iterator 
const_iterator
typedef std::list< std::string >
::const_iterator 
const_key_list_iterator
typedef std::map< std::string,
Cell >::iterator 
iterator
typedef std::list< std::string >
::iterator 
key_list_iterator

Public Member Functions

 Octave_map (const dim_vector &dv=dim_vector(0, 0), const Cell &key_vals=Cell())
 Octave_map (const std::string &k, const octave_value &value)
 Octave_map (const std::string &k, const Cell &vals)
 Octave_map (const std::string &k, const octave_value_list &val_list)
 Octave_map (const string_vector &sv, const dim_vector &dv=dim_vector(0, 0))
 Octave_map (const Octave_map &m)
 Octave_map (const octave_map &m)
 ~Octave_map (void)
Octave_mapassign (const std::string &k, const Cell &rhs)
Octave_mapassign (const octave_value_list &idx, const Octave_map &rhs)
Octave_mapassign (const octave_value_list &idx, const std::string &k, const Cell &rhs)
Octave_mapassign (const std::string &k, const octave_value &rhs)
iterator begin (void)
const_iterator begin (void) const
void clear (void)
octave_idx_type columns (void) const
Octave_map concat (const Octave_map &rb, const Array< octave_idx_type > &ra_idx)
bool contains (const std::string &k) const
Cellcontents (iterator p)
Cellcontents (const std::string &k)
Cell contents (const_iterator p) const
Cell contents (const std::string &k) const
void del (const std::string &k)
dim_vector dims (void) const
iterator end (void)
const_iterator end (void) const
Octave_map index (const octave_value_list &idx, bool resize_ok=false) const
int intfield (const std::string &k, int def_val=0) const
std::string key (const_iterator p) const
string_vector keys (void) const
Octave_mapmaybe_delete_elements (const octave_value_list &idx)
int ndims (void) const
octave_idx_type nfields (void) const
octave_idx_type numel (void) const
Octave_mapoperator= (const Octave_map &m)
Octave_map permute (const Array< int > &vec, bool inv=false) const
Octave_map reshape (const dim_vector &new_dims) const
void resize (const dim_vector &dv, bool fill=false)
octave_idx_type rows (void) const
iterator seek (const std::string &k)
const_iterator seek (const std::string &k) const
Octave_map squeeze (void) const
std::string stringfield (const std::string &k, const std::string &def_val=std::string()) const
Octave_map transpose (void) const

Private Member Functions

void maybe_add_to_key_list (const std::string &k)

Private Attributes

dim_vector dimensions
std::list< std::string > key_list
std::map< std::string, Cellmap

Detailed Description

Definition at line 479 of file oct-map.h.


Member Typedef Documentation

typedef std::map<std::string, Cell>::const_iterator Octave_map::const_iterator

Definition at line 486 of file oct-map.h.

typedef std::list<std::string>::const_iterator Octave_map::const_key_list_iterator

Definition at line 489 of file oct-map.h.

typedef std::map<std::string, Cell>::iterator Octave_map::iterator

Definition at line 485 of file oct-map.h.

typedef std::list<std::string>::iterator Octave_map::key_list_iterator

Definition at line 488 of file oct-map.h.


Constructor & Destructor Documentation

Octave_map::Octave_map ( const dim_vector dv = dim_vector (0, 0),
const Cell key_vals = Cell () 
)

Definition at line 1313 of file oct-map.cc.

References error(), Cell::is_cellstr(), key_list, map, and Array< T >::numel().

Octave_map::Octave_map ( const std::string &  k,
const octave_value value 
) [inline]

Definition at line 496 of file oct-map.h.

Octave_map::Octave_map ( const string_vector sv,
const dim_vector dv = dim_vector (0, 0) 
) [inline]

Definition at line 503 of file oct-map.h.

References Array< T >::length().

Octave_map::Octave_map ( const std::string &  k,
const Cell vals 
) [inline]

Definition at line 515 of file oct-map.h.

Octave_map::Octave_map ( const std::string &  k,
const octave_value_list val_list 
) [inline]

Definition at line 522 of file oct-map.h.

Octave_map::Octave_map ( const Octave_map m  )  [inline]

Definition at line 529 of file oct-map.h.

Octave_map::Octave_map ( const octave_map m  ) 
Octave_map::~Octave_map ( void   )  [inline]

Definition at line 546 of file oct-map.h.


Member Function Documentation

Octave_map & Octave_map::assign ( const octave_value_list idx,
const Octave_map rhs 
)
Octave_map & Octave_map::assign ( const octave_value_list idx,
const std::string &  k,
const Cell rhs 
)
Octave_map & Octave_map::assign ( const std::string &  k,
const octave_value rhs 
)
Octave_map & Octave_map::assign ( const std::string &  k,
const Cell rhs 
)

Definition at line 1714 of file oct-map.cc.

References dimensions, dims(), Array< T >::dims(), error(), map, maybe_add_to_key_list(), and nfields().

iterator Octave_map::begin ( void   )  [inline]
const_iterator Octave_map::begin ( void   )  const [inline]

Definition at line 573 of file oct-map.h.

void Octave_map::clear ( void   )  [inline]

Definition at line 600 of file oct-map.h.

octave_idx_type Octave_map::columns ( void   )  const [inline]

Definition at line 610 of file oct-map.h.

Octave_map Octave_map::concat ( const Octave_map rb,
const Array< octave_idx_type > &  ra_idx 
)
bool Octave_map::contains ( const std::string &  k  )  const [inline]

Definition at line 597 of file oct-map.h.

Referenced by assign().

Cell & Octave_map::contents ( const std::string &  k  ) 
Cell Octave_map::contents ( const std::string &  k  )  const

Definition at line 1392 of file oct-map.cc.

References end(), and seek().

Cell& Octave_map::contents ( iterator  p  )  [inline]

Definition at line 583 of file oct-map.h.

Cell Octave_map::contents ( const_iterator  p  )  const [inline]

Definition at line 586 of file oct-map.h.

void Octave_map::del ( const std::string &  k  )  [inline]

Definition at line 555 of file oct-map.h.

References find().

dim_vector Octave_map::dims ( void   )  const [inline]

Definition at line 612 of file oct-map.h.

Referenced by assign(), concat(), permute(), reshape(), resize(), squeeze(), and transpose().

const_iterator Octave_map::end ( void   )  const [inline]

Definition at line 576 of file oct-map.h.

iterator Octave_map::end ( void   )  [inline]
Octave_map Octave_map::index ( const octave_value_list idx,
bool  resize_ok = false 
) const
int Octave_map::intfield ( const std::string &  k,
int  def_val = 0 
) const

Definition at line 1400 of file oct-map.cc.

References contents(), and Array< T >::is_empty().

std::string Octave_map::key ( const_iterator  p  )  const [inline]
string_vector Octave_map::keys ( void   )  const

Definition at line 1427 of file oct-map.cc.

References key_list, and nfields().

Referenced by keys_ok(), maybe_delete_elements(), and save_mat5_binary_element().

void Octave_map::maybe_add_to_key_list ( const std::string &  k  )  [inline, private]

Definition at line 652 of file oct-map.h.

Referenced by assign(), and contents().

Octave_map & Octave_map::maybe_delete_elements ( const octave_value_list idx  ) 
int Octave_map::ndims ( void   )  const [inline]

Definition at line 614 of file oct-map.h.

Referenced by transpose().

octave_idx_type Octave_map::nfields ( void   )  const [inline]
octave_idx_type Octave_map::numel ( void   )  const [inline]

Definition at line 622 of file oct-map.h.

Referenced by save_mat5_binary_element(), and save_mat5_element_length().

Octave_map& Octave_map::operator= ( const Octave_map m  )  [inline]

Definition at line 534 of file oct-map.h.

References dimensions, key_list, and map.

Octave_map Octave_map::permute ( const Array< int > &  vec,
bool  inv = false 
) const

Definition at line 1363 of file oct-map.cc.

References assign(), begin(), contents(), dims(), end(), error_state, key(), key_list, and Array< T >::permute().

Octave_map Octave_map::reshape ( const dim_vector new_dims  )  const

Definition at line 1458 of file oct-map.cc.

References assign(), begin(), contents(), dimensions, dims(), end(), key(), and key_list.

void Octave_map::resize ( const dim_vector dv,
bool  fill = false 
)
octave_idx_type Octave_map::rows ( void   )  const [inline]

Definition at line 608 of file oct-map.h.

const_iterator Octave_map::seek ( const std::string &  k  )  const [inline]

Definition at line 595 of file oct-map.h.

iterator Octave_map::seek ( const std::string &  k  )  [inline]

Definition at line 594 of file oct-map.h.

Referenced by concat(), and contents().

Octave_map Octave_map::squeeze ( void   )  const

Definition at line 1342 of file oct-map.cc.

References assign(), begin(), contents(), dims(), end(), error_state, key(), key_list, and Array< T >::squeeze().

std::string Octave_map::stringfield ( const std::string &  k,
const std::string &  def_val = std::string () 
) const

Definition at line 1413 of file oct-map.cc.

References contents(), and Array< T >::is_empty().

Octave_map Octave_map::transpose ( void   )  const

Definition at line 1435 of file oct-map.cc.

References assign(), begin(), contents(), dims(), end(), key(), key_list, and ndims().


Member Data Documentation

dim_vector Octave_map::dimensions [mutable, private]

Definition at line 650 of file oct-map.h.

Referenced by assign(), maybe_delete_elements(), operator=(), reshape(), and resize().

std::list<std::string> Octave_map::key_list [private]

Definition at line 647 of file oct-map.h.

Referenced by concat(), index(), keys(), Octave_map(), operator=(), permute(), reshape(), squeeze(), and transpose().

std::map<std::string, Cell> Octave_map::map [private]

Definition at line 643 of file oct-map.h.

Referenced by assign(), contents(), Octave_map(), and operator=().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines