1 #ifndef __VALUE_2_OS_H__
2 #define __VALUE_2_OS_H__
4 #include "stg/ObjectSyntax.h"
7 bool ValueToOS(const T & value, ObjectSyntax * objectSyntax);
11 bool ValueToOS<int>(const int & value, ObjectSyntax * objectSyntax)
13 objectSyntax->present = ObjectSyntax_PR_simple;
14 SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
15 simpleSyntax->present = SimpleSyntax_PR_number;
16 asn_long2INTEGER(&simpleSyntax->choice.number, value);
22 bool ValueToOS<unsigned int>(const unsigned int & value, ObjectSyntax * objectSyntax)
24 objectSyntax->present = ObjectSyntax_PR_simple;
25 SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
26 simpleSyntax->present = SimpleSyntax_PR_number;
27 asn_long2INTEGER(&simpleSyntax->choice.number, value);
33 bool ValueToOS<long>(const long & value, ObjectSyntax * objectSyntax)
35 objectSyntax->present = ObjectSyntax_PR_simple;
36 SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
37 simpleSyntax->present = SimpleSyntax_PR_number;
38 asn_long2INTEGER(&simpleSyntax->choice.number, value);
44 bool ValueToOS<unsigned long>(const unsigned long & value, ObjectSyntax * objectSyntax)
46 objectSyntax->present = ObjectSyntax_PR_simple;
47 SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
48 simpleSyntax->present = SimpleSyntax_PR_number;
49 asn_long2INTEGER(&simpleSyntax->choice.number, value);
55 bool ValueToOS<std::string>(const std::string & value, ObjectSyntax * objectSyntax)
57 objectSyntax->present = ObjectSyntax_PR_simple;
58 SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
59 simpleSyntax->present = SimpleSyntax_PR_string;
60 OCTET_STRING_fromBuf(&simpleSyntax->choice.string, value.c_str(), static_cast<int>(value.length()));