NonStop Serverware

OperationDef

Previous Topic | Next Topic | Contents | Index
Getting Started | Administration Guide | Programmer's Guide

Subtopics

OperationDef Syntax
OperationDef::contexts
OperationDef::exceptions
OperationDef::describe( )
OperationDef::mode
OperationDef::params
OperationDef::result
OperationDef::result_def

The OperationDef interface describes an IDL operation. It inherits from Contained. The parameters and exceptions of the operation are not available directly as attributes but are available by using the Contained::describe( ) inherited operation.

An example use of OperationDef is to construct an NVList for a specific operation.

OperationDef Syntax

module CORBA {

enum OperationMode { OP_NORMAL, OP_ONEWAY };

enum ParameterMode { PARAM_IN, PARAM_OUT, PARAM_INOUT };

struct ParameterDescription {
    Identifier <name>;
    TypeCode <type>;
    IDLType type_def;
    ParameterMode <mode>;
}
typedef sequence <ParameterDescription> ParDescriptionSeq;

typedef Identifier <ContextIdentifier>;
typedef sequence <ContextIdentifier> ContextIdSeq;

typedef sequence <ExceptionDescription> ExcDescriptionSeq;
 
interface OperationDef : Contained {
    readonly attribute TypeCode <result>;
    attribute IDLType <result_def>;
    attribute ParDescriptionSeq <params>;
    attribute OperationMode <mode>;
    attribute ContextIdSeq <contexts>;
    attribute ExceptionDefSeq <exceptions>;
};
};

See Also

Contained
ExceptionDef

OperationDef::contexts

This method gives the list of context identifiers specified in the context clause of the operation.

Syntax

attribute ContextIdentifierSeq contexts;

OperationDef::exceptions

OperationDef::exceptions is the list of exceptions that the operation can raise.

Syntax

attribute ExceptionDefSeq

See Also

ExceptionDef

OperationDef::describe( )

The operation describe( ) is inherited from Contained. It returns a structure of type Contained::Description:

Syntax

struct Description {
 	DefinitionKind <kind>;
 	any <value>;
};

Parameters

<kind>
The DefinitionKind for the kind member is dk_Operation".

<value>
A structure of type OperationDescription:

struct OperationDescription {
    Identifier <name>;
    RepositoryId <id>;
    RepositoryId defined_in;
    VersionSpec <version>;
    TypeCode <result>;
    OperationDef::OperationMode <mode>;
    ContextIdSeq <contexts>;
    ParDescriptionSeq <parameters>;
    ExcDescriptionSeq <exceptions>;
};

The TypeCode of the <value> member is:

_tc_OperationDescription

See Also

Contained::describe( )
ExceptionDef

OperationDef::mode

This method specifies whether the operation is normal (NORMAL) or oneway (ONEWAY).

Syntax

attribute OperationMode <mode>;

Description

Because the C++ compiler does not support nesting, NORMAL is renamed to NORMAL_OP. This prevents a conflict with the enum AttributeDef::AttributeMode.

OperationDef::params

This method specifies the parameters for this operation.

Syntax

attribute ParDescriptionSeq <params>;

Description

It is a sequence of structures of type ParameterDescription:

struct ParameterDescription {
    Identifier <name>;
    TypeCode <type>;
    IDLType type_def;
    ParameterMode <mode>;
};

The <name> member provides the name for the parameter. The <type> member identifies the TypeCode for the parameter. The <mode> specifies whether the parameter is an in

(PARAM_IN), an out (PARAM_OUT), or an inout (PARAM_INOUT).

See Also

CORBA::Typecode

OperationDef::result

This method specifies the TypeCode of the operation's return value.

Syntax

readonly attribute TypeCode <result>;

See Also

CORBA::Typecode
OperationDef::result_def

OperationDef::result_def

This method defines the return type for this operation. The attribute result_def also contains the return type and setting it also updates the result attribute.

Syntax

attribute IDLType <result_def>;

See Also

OperationDef::result


Previous Topic | Next Topic | Contents | Top
Getting Started Guide | Administration Guide | Programmer's Guide
Bibliography | Glossary | Index
© Tandem, a division of Compaq. All rights reserved. Legal notices.