-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCStackMapCommand.h
More file actions
101 lines (67 loc) · 2.3 KB
/
CStackMapCommand.h
File metadata and controls
101 lines (67 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
This software is Copyright by the Board of Trustees of Michigan
State University (c) Copyright 2005.
You may use this software under the terms of the GNU public license
(GPL). The terms of this license are described at:
http://www.gnu.org/licenses/gpl.txt
Author:
Ron Fox
NSCL
Michigan State University
East Lansing, MI 48824-1321
*/
#ifndef __CSTACKMAPCOMMAND_H
#define __CSTACKMAPCOMMAND_H
#ifndef __TCLOBJECTCOMMAND_H
#include <TCLObjectProcessor.h>
#endif
#ifndef __CPARAMMAPCOMMAND_
#include "CParamMapCommand.h"
#endif
class CTCLObject;
class CTCLInterpreter;
/*!
This class implements the Tcl stackMap command extension to SpecTcl.
This extension is responsible for producing the data structures that
drive the unpacking of VM-USB events. Each stack consists of a vector of
pointers to AdcMapping structs. The map contains a code used to select the
unpacker for that module. It also contains an array of parameter ids corresponding
to the channels of the module.
The form of the command is:
\verbatim
stackMap stacknum modules
\endverbatim
where:
- stacknum - is the number of the VM-USB stack being described.
- modules - is a list of modules in the stack in the order in which they are
read.
If stackMap is repeated for a stack that's already defined, the
stack mapping is silently replaced.
*/
class CStackMapCommand : public CTCLObjectProcessor
{
// Exported data:
public:
typedef std::vector<CParamMapCommand::AdcMapping*> stackMap;
// Private data:
static stackMap m_stacks[8]; // There are 8 stacks... no more no less.
// Constructors and canonicals:
CStackMapCommand(CTCLInterpreter& interp, std::string name = std::string("stackMap"));
virtual ~CStackMapCommand();
private:
CStackMapCommand(const CStackMapCommand& rhs);
CStackMapCommand& operator=(const CStackMapCommand& rhs);
int operator==(const CStackMapCommand& rhs) const;
int operator!=(const CStackMapCommand& rhs) const;
public:
static const stackMap& getMap(int number);
// Virtual function overrides:
protected:
virtual int operator()(CTCLInterpreter& interp,
STD(vector)<CTCLObject>& objv);
// Utilities:
private:
static std::string Usage();
static void clearMap(stackMap& map);
};
#endif