Flip Reference

 

Enum Template Class Reference

Namespace

ohm::flip

Inherits from

ohm::flip::Object

Declared in

ohm/flip/Enum.h

Companion Guide

Flip Programming Guide: Writing a Flip Class Part 1

Flip Programming Guide: Using Enums

See Also

ohm::flip::EnumDescManager

ohm::flip::EnumDescription

Overview

The Enum template class implements a Flip value type holding an enum value. The following sections will only document the public API.

Template Parameters Overview

Partial Class Diagram

Methods Overview

Assigning

Casting

Comparing

Differencing

Template Parameters

EnumType

The enum itself.

MIN

Minimum value of the enum . A valid enum value must be in the range [MIN; MIN + NBR) . Failure to achieve this will be report as a structural validation failure from the server.

NBR

The number of values in the enum . A valid enum value must be in the range [MIN; MIN + NBR) . Failure to achieve this will be report as a structural validation failure from the server.

Methods

ctor

Sets the value at post construction stage.

virtual void   ctor (ohm::flip::Args & args);
void           ctor (EnumType val);

The first version sets the value from a cascaded arguments object ohm::flip::Args

operator =

Sets the value.

Enum &         operator = (EnumType val);

Returns a reference to this .

operator bool

Returns the value of this .

               operator EnumType () const;

WARNING:it is invalid to call this function when the object is being restored

get_old_value

Returns the old value of this .

EnumType       get_old_value () const;

WARNING:it is invalid to call this function when the object is being inited

operator ==

Returns true if the right handed value is equal to this , false otherwise.

               operator == (EnumType val) const;

operator !=

Returns true if the right handed value is not equal to this , false otherwise.

               operator != (EnumType val) const;

did_value_change

Returns true if the old value is different from the current value.

bool           did_value_change () const;

Note:Outside of an observer document_changed call, this will always return false