~uhh-ssd/+junk/Alibava_Control

« back to all changes in this revision

Viewing changes to src/BeetleConfig.h

  • Committer: jo-erfle
  • Date: 2012-08-10 07:56:52 UTC
  • Revision ID: joachim.erfle@desy.de-20120810075652-1dnlv58fde8xeaou
initial commit with alibava v3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++ -*- */
 
2
#ifndef __BeetleConfig_h__
 
3
#define __BeetleConfig_h__
 
4
 
 
5
#include <string>
 
6
#include <map>
 
7
#include <ConfigFile.h>
 
8
 
 
9
class BeetleConfig : public std::map<const char *, unsigned short>, public ConfigFile
 
10
{
 
11
    private:
 
12
        short _mask;
 
13
        void cpy(const BeetleConfig &b);
 
14
 
 
15
    public:
 
16
        BeetleConfig();
 
17
        BeetleConfig(const BeetleConfig &b)
 
18
        {
 
19
            cpy(b);
 
20
        }
 
21
        ~BeetleConfig()
 
22
        {
 
23
        }
 
24
 
 
25
        BeetleConfig &operator=(const BeetleConfig &b)
 
26
        {
 
27
            if ( this!=&b)
 
28
                cpy(b);
 
29
 
 
30
            return *this;
 
31
        }
 
32
        void load_data();
 
33
        void save_data();
 
34
 
 
35
        short mask() { return _mask; }
 
36
        void  mask(short x) { _mask = x; }
 
37
 
 
38
        unsigned short addr(int i) const;
 
39
};
 
40
 
 
41
#endif