arbb::scalar< scalar_type > Class Template Reference

Template representing any scalar types (such as arbb::f32). More...

Inheritance diagram for arbb::scalar< scalar_type >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 scalar ()
 Default constructor.
 scalar (const scalar &other)
 Copy constructor.
 scalar (const typename uncaptured< scalar >::type &data)
 Constructs a scalar whose value is initialized to data.
template<arbb_scalar_type_t other_scalar_type>
 scalar (const scalar< other_scalar_type > &other)
 Conversion constructor.
scalaroperator= (const scalar &other)
 Assignment operator.
scalaroperator= (const typename uncaptured< scalar >::type &data)
 Sets this scalar to data.
template<arbb_scalar_type_t other_scalar_type>
scalaroperator= (const scalar< other_scalar_type > &other)
 Conversion assignment operator.

Detailed Description

template<arbb_scalar_type_t scalar_type>
class arbb::scalar< scalar_type >

Template representing any scalar types (such as arbb::f32).

Instantiations of this template are considered captured scalar types, because operations on them are captured as part of a closure definition (see Function Invocation, Closures). The template parameter scalar_type is one of the arbb_scalar_type_t enumeration values (see Types). Normally, you should not use this template directly in your code. Use one of the predefined type definitions (such as arbb::f32) or the arbb::captured type trait (for example, arbb::captured<float>::type) instead.

See Also

Scalar Functions

Definition at line 41 of file scalar.hpp.


Constructor & Destructor Documentation

template<arbb_scalar_type_t scalar_type>
arbb::scalar< scalar_type >::scalar (  ) 

Default constructor.

Implicitly initializes the scalar to a zero value upon construction.

template<arbb_scalar_type_t scalar_type>
arbb::scalar< scalar_type >::scalar ( const scalar< scalar_type > &  other  ) 

Copy constructor.

Constructs a scalar with the same value as other.

template<arbb_scalar_type_t scalar_type>
arbb::scalar< scalar_type >::scalar ( const typename uncaptured< scalar< scalar_type > >::type &  data  ) 

Constructs a scalar whose value is initialized to data.

template<arbb_scalar_type_t scalar_type>
template<arbb_scalar_type_t other_scalar_type>
arbb::scalar< scalar_type >::scalar ( const scalar< other_scalar_type > &  other  )  [inline]

Conversion constructor.

Constructs a scalar with the value of other converted to this type. The following code example calls this constructor:

 arbb::i32 a = arbb::f32(1.1);
 assert(1 == arbb::value(a));

Member Function Documentation

template<arbb_scalar_type_t scalar_type>
scalar& arbb::scalar< scalar_type >::operator= ( const scalar< scalar_type > &  other  ) 

Assignment operator.

Sets this scalar to the same value as other.

template<arbb_scalar_type_t scalar_type>
scalar& arbb::scalar< scalar_type >::operator= ( const typename uncaptured< scalar< scalar_type > >::type &  data  ) 

Sets this scalar to data.

template<arbb_scalar_type_t scalar_type>
template<arbb_scalar_type_t other_scalar_type>
scalar& arbb::scalar< scalar_type >::operator= ( const scalar< other_scalar_type > &  other  )  [inline]

Conversion assignment operator.

Sets this scalar to the value of other converted to this type. The following code example calls this operator:

 arbb::i32 a;
 a = arbb::f32(1.1);
 assert(1 == arbb::value(a));

The documentation for this class was generated from the following file:

Submit feedback on this help topic

Copyright © 2010, Intel Corporation. All rights reserved.