S1APContainer.h 1.6 KB
Newer Older
C
calincerchez 已提交
1
//
C
calincerchez 已提交
2 3
// Copyright (C) 2012 Calin Cerchez
//
C
calincerchez 已提交
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
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#ifndef S1APCONTAINER_H_
#define S1APCONTAINER_H_

#include "ASNTypes.h"
#include "S1APConstant.h"
#include "PerDecoder.h"

class ProtocolIeField : public Sequence {
private:
	static const void *itemsInfo[3];
	static bool itemsPres[3];
public:
	static const Info theInfo;
	ProtocolIeField(unsigned short id, unsigned char crit, AbstractType *val);
C
calincerchez 已提交
32

C
calincerchez 已提交
33 34 35 36 37 38 39 40
	unsigned short getProtocolId() const { return static_cast<IntegerBase*>(items.at(0))->getValue(); }
	OpenType *getValue() const { return static_cast<OpenType*>(items.at(2)); }

	void setValue(OpenType *val);
};

typedef ProtocolIeField ProtocolIeSingleContainer;

C
calin 已提交
41
typedef SequenceOf<ProtocolIeField, SizeConstraint<CONSTRAINED, 0, maxProtocolIEs>> ProtocolIeContainer;
C
calincerchez 已提交
42 43 44 45
OpenType *findValue(ProtocolIeContainer *container, unsigned short id);

typedef ProtocolIeField ProtocolExtField;

C
calin 已提交
46
typedef SequenceOf<ProtocolExtField, SizeConstraint<CONSTRAINED, 0, maxProtocolIEs>> ProtocolExtContainer;
C
calincerchez 已提交
47 48 49

#endif /* S1APCONTAINER_H_ */