PandA-2024.02
asn_type.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2015-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
41 #ifndef ASN_TYPE_HPP
42 #define ASN_TYPE_HPP
43 
45 #include <string>
46 
48 #include <list>
49 
51 #include "refcount.hpp"
52 
54 
55 enum class AsnType_Kind
56 {
57  BOOLEAN,
58  CHOICE,
59  ENUMERATED,
60  INTEGER,
62  REAL,
63  REDEFINE,
64  SEQUENCE,
65  SEQUENCEOF,
66  SET,
67  SETOF
68 };
69 
70 class AsnType
71 {
72  protected:
75 
76  public:
80  explicit AsnType(const AsnType_Kind kind);
81 
85  virtual ~AsnType();
86 
90  AsnType_Kind GetKind();
91 };
92 
93 class BooleanAsnType : public AsnType
94 {
95  public:
100 };
101 
102 class ChoiceAsnType : public AsnType
103 {
104  public:
106  const std::list<std::pair<std::string, AsnTypeRef>> element_type_list;
107 
112  explicit ChoiceAsnType(std::list<std::pair<std::string, AsnTypeRef>> element_type_list);
113 };
114 
116 {
117  public:
119  const std::list<std::pair<std::string, unsigned int>> named_number_list;
120 
125  explicit EnumeratedAsnType(std::list<std::pair<std::string, unsigned int>> named_number_list);
126 };
127 
128 class IntegerAsnType : public AsnType
129 {
130  public:
134  IntegerAsnType();
135 };
136 
138 {
139  public:
141  size_t size;
142 
146  explicit OctetStringAsnType(const std::string& size);
147 
151  ~OctetStringAsnType() override;
152 };
153 
154 class RealAsnType : public AsnType
155 {
156  public:
160  RealAsnType();
161 };
162 
163 class RedefineAsnType : public AsnType
164 {
165  public:
167  const std::string name;
168 
173  explicit RedefineAsnType(std::string name);
174 };
175 
176 class SequenceAsnType : public AsnType
177 {
178  public:
180  const std::list<std::pair<std::string, AsnTypeRef>> fields;
181 
185  explicit SequenceAsnType(std::list<std::pair<std::string, AsnTypeRef>> _fields);
186 };
187 
189 {
190  public:
192  std::string element;
193 
195  size_t size;
196 
200  SequenceOfAsnType(std::string element, const std::string& size);
201 };
202 
203 class SetAsnType : public AsnType
204 {
205  public:
207  const std::list<std::pair<std::string, AsnTypeRef>> fields;
208 
212  explicit SetAsnType(std::list<std::pair<std::string, AsnTypeRef>> _fields);
213 };
214 
215 class SetOfAsnType : public AsnType
216 {
217  public:
219  std::string element;
220 
222  size_t size;
223 
227  SetOfAsnType(std::string element, const std::string& size);
228 };
229 
232 #endif
size_t size
The number of elements in the sequence.
Definition: asn_type.hpp:195
const AsnType_Kind kind
The actual kind.
Definition: asn_type.hpp:74
const std::list< std::pair< std::string, AsnTypeRef > > element_type_list
The list of name type.
Definition: asn_type.hpp:106
const std::string name
The redefined type.
Definition: asn_type.hpp:167
std::string element
The type of the element.
Definition: asn_type.hpp:192
std::string element
The type of the element.
Definition: asn_type.hpp:219
Template definition of refcount.
size_t size
The number of element in the set.
Definition: asn_type.hpp:222
REF_FORWARD_DECL(AsnType)
STD include.
size_t size
The size.
Definition: asn_type.hpp:141
const std::list< std::pair< std::string, unsigned int > > named_number_list
The list of enum.
Definition: asn_type.hpp:119
AsnType_Kind
Definition: asn_type.hpp:55
const std::list< std::pair< std::string, AsnTypeRef > > fields
The list of fields.
Definition: asn_type.hpp:180
const std::list< std::pair< std::string, AsnTypeRef > > fields
The list of fields.
Definition: asn_type.hpp:207

Generated on Mon Feb 12 2024 13:02:54 for PandA-2024.02 by doxygen 1.8.13