]> git.stg.codes - stg.git/commitdiff
Added specialization for unsigned in, long and unsigned long types
authorMaxim Mamontov <faust.madf@gmail.com>
Wed, 27 Jul 2011 11:44:10 +0000 (14:44 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Wed, 27 Jul 2011 11:44:10 +0000 (14:44 +0300)
projects/stargazer/plugins/other/smux/value2os.h

index 420616a1e97b8887f0bd18dcf4738706aa6c7fe9..20e624059c99d0cc38611b2a91d5e59c3bbbd4c9 100644 (file)
@@ -17,4 +17,37 @@ asn_long2INTEGER(&simpleSyntax->choice.number, value);
 return true;
 }
 
+template <>
+inline
+bool ValueToOS<unsigned int>(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);
+return true;
+}
+
+template <>
+inline
+bool ValueToOS<long>(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);
+return true;
+}
+
+template <>
+inline
+bool ValueToOS<unsigned long>(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);
+return true;
+}
+
 #endif