Flip Reference

 

Args Class Reference

Namespace

ohm::flip

Declared in

ohm/flip/Args.h

Companion Guide

Flip Programming Guide: Managing Pseudo Const Members

Used by

ohm::flip::Array

ohm::flip::Collection

Overview

The Args class implements the cascaded constructor arguments used when inserting objects in a container with default post constructor arguments.

All push functions returns a reference to this , so that it can be chained as in this typical example :

ohm::flip::Args ().push (true).push (2.0).push ("Some text")

The class itself works like a FIFO queue. Every value pushed will also push the associated type, so that all subsequent pop can be type checked.

Important:This class should be used only to pass parameters on construction to fill Flip class members that somehow needs to be constant during the lifetime of the object, typically members which do have getters but no setters. When using this class it is very usual to introduce bugs in the code, so if the object is not supposed to have a const member, first create the object and then modify it in a single transaction.

Partial Class Diagram

Methods Overview

Pushing

Popping

Methods

push (bool)

Push a bool value in this.

Args &         push (bool val);

push (ohm::archi::Int64)

Push a ohm::archi::Int64 value in this.

Args &         push (ohm::archi::Int64 val);

push (archi::Float64 val)

Push a ohm::archi::Float64 value in this.

Args &         push (ohm::archi::Float64 val);

push (const std::string &)

Push a const std::string & as an opaque data in this.

Args &         push (const std::string & str);

push (const std::vector &)

Push a const std::vector <ohm::archi::UByte> & as an opaque data in this.

Args &         push (const std::string & str);

push (const ohm::archi::UByte *, size_t)

Push a the data from val_ptr to val_ptr + val_size as an opaque data in this.

Args &         push (const ohm::archi::UByte * val_ptr, size_t val_size);

push (ohm::flip::Object &)

Push the object reference as a 64 bits integer in this.

Args &         push (ohm::flip::Object & object);

pop (bool &)

Pop a bool from this and fill it into val .

void           pop (bool & val);

pop (ohm::flip::Bool &)

Pop a bool from this and fill it into the Flip object val .

void           pop (ohm::flip::Bool & val);

pop (ohm::archi::Int64 &)

Pop a 64 bits integer from this and fill it into val .

void           pop (ohm::archi::Int64 & val);

pop (ohm::flip::Int64 &)

Pop a 64 bits integer from this and fill it into the Flip object val .

void           pop (ohm::flip::Int64 & val);

pop (ohm::flip::EnumMaster &)

Pop a 64 bits integer from this and fill it into the Flip object val by static casting it to the enum represented by ohm::flip::EnumMaster .

void           pop (ohm::flip::EnumMaster & val);

pop (ohm::archi::Float64 &)

Pop a 64 bits floating point value from this and fill it into val .

void           pop (ohm::archi::Float64 & val);

pop (ohm::flip::Float64 &)

Pop a 64 bits floating point value from this and fill it into the Flip object val .

void           pop (ohm::flip::Float64 & val);

pop (const ohm::archi::UByte * &, size_t &)

Pop an opaque data from this and make data_ptr points to the beginning of the opaque data and fill data_size with the opaque data size.

void           pop (const archi::UByte * & data_ptr, size_t & data_size);

Important:data_ptr must not be released.

pop (std::string &)

Pop an opaque data from this and fill it into str .

void           pop (std::string & str);

pop (ohm::flip::Blob &)

Pop an opaque data from this and fill it into the Flip object val .

void           pop (ohm::flip::Blob & val);

pop (ohm::flip::ObjectRefMaster &)

Pop a 64 bits integer from this reinterpret it as a Flip object reference and assign it to the Flip object val . The reference can be dandling (ie. not pointing to a valid Flip object or an object matching the type of the ohm::flip::ObjectRef )

void           pop (ObjectRefMaster & val);