#pragma once #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #include "stg/ObjectSyntax.h" #pragma GCC diagnostic pop #include template void ValueToOS(const T & value, ObjectSyntax * objectSyntax); template <> inline void ValueToOS(const int & value, ObjectSyntax * objectSyntax) { objectSyntax->present = ObjectSyntax_PR_simple; SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; simpleSyntax->present = SimpleSyntax_PR_number; asn_long2INTEGER(&simpleSyntax->choice.number, value); } template <> inline void ValueToOS(const unsigned int & value, ObjectSyntax * objectSyntax) { objectSyntax->present = ObjectSyntax_PR_simple; SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; simpleSyntax->present = SimpleSyntax_PR_number; asn_long2INTEGER(&simpleSyntax->choice.number, value); } template <> inline void ValueToOS(const long & value, ObjectSyntax * objectSyntax) { objectSyntax->present = ObjectSyntax_PR_simple; SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; simpleSyntax->present = SimpleSyntax_PR_number; asn_long2INTEGER(&simpleSyntax->choice.number, value); } template <> inline void ValueToOS(const unsigned long & value, ObjectSyntax * objectSyntax) { objectSyntax->present = ObjectSyntax_PR_simple; SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; simpleSyntax->present = SimpleSyntax_PR_number; asn_long2INTEGER(&simpleSyntax->choice.number, value); } template <> inline void ValueToOS(const std::string & value, ObjectSyntax * objectSyntax) { objectSyntax->present = ObjectSyntax_PR_simple; SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; simpleSyntax->present = SimpleSyntax_PR_string; OCTET_STRING_fromBuf(&simpleSyntax->choice.string, value.c_str(), static_cast(value.length())); }