Macro BOOST_IDL_BEGINxxx

Description
Headers
Synopsis
Reference
BOOST_IDL_BEGIN
BOOST_IDL_BEGINz
BOOST_IDL_BEGIN_TEMPLATE

Description

The macros BOOST_IDL_BEGIN, BOOST_IDL_BEGINz and BOOST_IDL_BEGIN_TEMPLATE are used to begin an interface definition in the macro-based interface definition language (IDL).

To Do

Headers

<boost/interfaces.hpp>
<boost/interfaces/detail/idl/begin.hpp>

Synopsis

#define BOOST_IDL_BEGIN_TEMPLATE(name, arity) ...
#define BOOST_IDL_BEGIN(name)  BOOST_IDL_BEGIN_TEMPLATE(name, 0)
#define BOOST_IDL_BEGIN1(name) BOOST_IDL_BEGIN_TEMPLATE(name, 1)
#define BOOST_IDL_BEGIN2(name) BOOST_IDL_BEGIN_TEMPLATE(name, 2)
...
#define BOOST_IDL_BEGINN(name) BOOST_IDL_BEGIN_TEMPLATE(name, N)

Reference

BOOST_IDL_BEGIN

#define BOOST_IDL_BEGIN(name) ...
Parameters
name- The name of the interface being defined

The macro BOOST_IDL_BEGIN(name) is used to begin the definition of a non-templated interface name. E.g., the following IDL definition

BOOST_IDL_BEGIN(IBar)
    BOOST_IDL_FN0(foo, void)
BOOST_IDL_END(IBar)

is equivalent to the pseudocode

interface IBar {
    void foo();
};

BOOST_IDL_BEGINz

#define BOOST_IDL_BEGINz(name) ...
Parameters
name- The name of the interface being defined

The macro BOOST_IDL_BEGINz(name) is used to begin the definition of a z-ary templated interface name. The keword template and the template parameter list must precede BOOST_IDL_BEGINz. E.g., the following IDL definition

template<typename T>
BOOST_IDL_BEGIN1(IStack)
    BOOST_IDL_CONST_FN0(empty, bool)
    BOOST_IDL_FN1(push, void, const T&)
    BOOST_IDL_FN0(pop, void)
    BOOST_IDL_FN0(top, T&)
    BOOST_IDL_CONST_FN0(top, const T&)
BOOST_IDL_END1(IStack)

is equivalent to the pseudocode

template<typename T>
interface IStack {
    bool empty() const;
    void push(const T&);
    void pop();
    T& top();
    const T& top() const;
};

BOOST_IDL_BEGIN_TEMPLATE

#define BOOST_IDL_BEGIN_TEMPLATE(name, arity) ...
Parameters
name- The name of the interface being defined
arity- The template arity of the interface being defined

The macro BOOST_IDL_BEGIN_TEMPLATE(name, arity) is used to begin the definition of a templated interface name, if arity is non-zero, and a non-templated interface name otherwise. In the case of a templated interface, the keword template and the template parameter list must precede BOOST_IDL_BEGIN_TEMPLATE. E.g., the following IDL definition

template<typename T>
BOOST_IDL_BEGIN_TEMPLATE(IStack, 1)
    BOOST_IDL_CONST_FN0(empty, bool)
    BOOST_IDL_FN1(push, void, const T&)
    BOOST_IDL_FN0(pop, void)
    BOOST_IDL_FN0(top, T&)
    BOOST_IDL_CONST_FN0(top, const T&)
BOOST_IDL_END_TEMPLATE(IStack, 1)

is equivalent to the pseudocode

template<typename T>
interface IStack {
    bool empty() const;
    void push(const T&);
    void pop();
    T& top();
    const T& top() const;
};

Sha'arei Tefila, an Orthodox Shul (Synagogue) in Salt Lake City, Utah Chabad Lubavitch of Utah