openvrml::mfcolor Class Reference
A color array node field value.
More...
#include <openvrml/field_value.h>
List of all members.
Detailed Description
A color array node field value.
- Model of
- Field Value
Member Typedef Documentation
Constructor & Destructor Documentation
openvrml::mfcolor::mfcolor |
( |
std::vector< color >::size_type |
n = 0 , |
|
|
const color & |
value = color() | |
|
) |
| | throw ( std::bad_alloc ) [explicit] |
Construct.
Creates an mfcolor
with n
copies of value
.
- Parameters:
-
[in] | n | the number elements in the mfcolor. |
[in] | value | used to initialize the mfcolor. |
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
- Postcondition:
- size is
n
. Every element is a copy of value
.
openvrml::mfcolor::mfcolor |
( |
const value_type & |
value |
) |
throw ( std::bad_alloc ) [inline, explicit] |
Construct.
- Parameters:
-
[in] | value | initial value. |
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
openvrml::mfcolor::mfcolor |
( |
const mfcolor & |
mfc |
) |
|
Construct a copy.
- Parameters:
-
[in] | mfc | the instance to copy. |
openvrml::mfcolor::~mfcolor |
( |
|
) |
throw () [virtual] |
Destroy.
Each of the mfcolor
's value elements is destroyed, and memory allocated for them (if any) is deallocated.
Member Function Documentation
Assign.
- Parameters:
-
[in] | mfc | the value to assign. |
- Returns:
- a reference to the instance.
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
void openvrml::mfcolor::value |
( |
const value_type & |
val |
) |
throw ( std::bad_alloc ) |
Mutate.
- Parameters:
-
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
void openvrml::mfcolor::swap |
( |
mfcolor & |
mfc |
) |
throw () |
Swap.
- Parameters:
-
[in,out] | mfc | the value to swap with this one. |
std::auto_ptr< openvrml::field_value > openvrml::mfcolor::do_clone |
( |
|
) |
const throw ( std::bad_alloc ) [private, virtual] |
Polymorphically construct a copy.
- Returns:
- a pointer to a copy of the object.
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
Implements openvrml::field_value.
Virtual assignment.
- Returns:
- a reference to the object.
- Exceptions:
-
| std::bad_cast | if value is not an mfcolor object. |
| std::bad_alloc | if memory allocation fails. |
void openvrml::mfcolor::print |
( |
std::ostream & |
out |
) |
const [private, virtual] |
Friends And Related Function Documentation
bool operator== |
( |
const mfcolor & |
lhs, |
|
|
const mfcolor & |
rhs | |
|
) |
| | throw() [related] |
Compare for equality.
- Parameters:
-
[in] | lhs | left-hand operand. |
[in] | rhs | right-hand operand. |
- Returns:
true
if lhs
and rhs
have the same value; false
otherwise.
bool operator!= |
( |
const mfcolor & |
lhs, |
|
|
const mfcolor & |
rhs | |
|
) |
| | throw() [related] |
Compare for inequality.
- Parameters:
-
[in] | lhs | left-hand operand. |
[in] | rhs | right-hand operand. |
- Returns:
true
if lhs
and rhs
do not have the same value; false
otherwise.
Swap the values of a
and b
.
Does not throw.
- Parameters:
-
Member Data Documentation