casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
record.h
Go to the documentation of this file.
1 #ifndef __casac_record_h__
2 #define __casac_record_h__
3 
4 #include <map>
5 #include <string>
6 #include <stdcasa/variant.h>
7 
8 namespace casac {
9 
10 typedef std::map<std::string,variant> rec_map;
11 
12 // todo: o create python to/from record functions
13 // o implement compare()
14 // o implement record_to_string()
15 // o create a thorough test program
16 // o verify that std::map<>'s copy ctor does a complete copy
17 // o add copy-on-write (w/ reference counting)
18 //
19 class record : public rec_map {
20  public:
21  typedef rec_map::iterator iterator;
23  typedef rec_map::value_type value_type;
24 
25  record();
26  record *clone() const { return new record(*this); }
27  int compare(const record*) const;
28 
29  record( const record &r ) : rec_map(r) { }
30  record &operator=(const record &r) { rec_map::operator=(r); return *this; }
31  std::pair<rec_map::iterator,bool> insert(const std::string &s,const variant &v);
32 };
33 record initialize_record( const std::string & );
34 } // casac namespace
35 
36 #endif
rec_map::iterator iterator
Definition: record.h:21
Elements::const_iterator const_iterator
std::map< std::string, variant > rec_map
Definition: record.h:10
std::pair< rec_map::iterator, bool > insert(const std::string &s, const variant &v)
int compare(const record *) const
PtrHolder< T > & operator=(const PtrHolder< T > &other)
todo: o create python to/from record functions o implement compare() o implement record_to_string() o...
Definition: record.h:19
record(const record &r)
Definition: record.h:29
rec_map::const_iterator const_iterator
Definition: record.h:22
record & operator=(const record &r)
Definition: record.h:30
record initialize_record(const std::string &)
record * clone() const
Definition: record.h:26
rec_map::value_type value_type
Definition: record.h:23