Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Integrals

The integrals of the ASN1 specification are supported in the Boost ASN1 library through a templated class called integral_t. This template is specialized for the four ASN1 integral data types.

ASN1 Type C++ Equiv
INTEGER integer_t
ENUM enum_t
REAL real_t
BOOLEAN boolean_t

The actual C++ integral (bool, int32_t, double) is encapsulated inside the integral_t object. This allows for programmer to simply create a Boost.ASN1 integral type and immediately start using it as a C++ integral.

integer_t asnInt(20);

int32_t nativeInt = asnInt;

real_t asnReal;

asnReal = asnInt;

The integral types support the fundamental operators required by C++ integral data types:

     
 operator   operator()   operator T() 
 operator<   operator<=   operator> 
 operator>=   operator==   operator!= 
 operator+=   operator-=   operator*= 
 operator/=   operator%=   operator|= 
 operator&=   operator^=   operator<<= 
 operator>>=   operator++   operator-- 
Copyright © 2007 Andreas Haberstroh

PrevUpHomeNext