# Spectra ORB

# C Edition

# Reference Guide

Version 2.1

# Copyright Notice

© 2016 PrismTech Limited. All rights reserved.

This document may be reproduced in whole but not in part.

The information contained in this document is subject to change without notice and is made available in good faith without liability on the part of PrismTech Limited or PrismTech Corporation.

All trademarks acknowledged.

Guide edition: 04 (1 September 2016)

# Table of Contents

# Chapter 1 Preface.. 5

1.1 About the Reference Guide. 5
1.1.1 Intended Audience.. .5
1.1.2 Organisation.. .5
1.2 Conventions.. .6
1.3 Contacts.. .7

# Chapter 2 General Information. .8

2.1 Common Mappings for IDL Types.. .8
2.2 Definitions.. .9

# Chapter 3 Standard API Reference.. .10

3.1 Function Signatures.. ..10
3.1.1 CORBA Module.. .10
3.1.1.1 Environment.. .10
3.1.1.2 Exceptions.. .10
3.1.1.3 Fixed Types... .12
3.1.1.4 General.
3.1.1.5 Sequences.. ..14
3.1.1.6 Strings.. ..15
3.1.1.7 Any Interface.. .15
3.1.1.8 Object Interface.. ..16
3.1.1.9 ORB Interface. ..20
3.1.1.10 Policy Interface.. .27
3.1.1.11 PolicyCurrent Interface.. .28
3.1.1.12 PolicyManager Interface. .28
3.1.1.13 TypeCode Interface.. .29
3.1.1.14 LocalObject Interface. .30
3.1.1.15 DataInputStream Value Type.. .30
3.1.1.16 DataOutputStream Value Type.. ..33
3.1.2 PortableInterceptor Module.. ..35
3.1.2.1 ORBInitializer Local Interface.. ..35
3.1.2.2 ORBInitInfo Local Interface.. .36
3.1.3 EORB Module.. .37
3.1.4 PortableServer Module.. .38
3.1.4.1 POA Interface. ..39
3.1.4.2 Current Interface. ..46
3.1.4.3 POAManager Interface.. ..47
3.1.5 Messaging Module.. .47
3.1.5.1 SyncScopePolicy Interface. ..48
3.1.6 IOP::Codec Module.. ..48
3.1.6.1 CodecFactory Interface. ..49
3.1.6.2 Codec Interface. ..49
3.2 CORBA Exceptions.. .51
3.3 Standard User Exceptions..
3.4 Standard System Exceptions.. .57
3.5 Policies. ..60
3.5.1 Policy Values.. ..60
3.5.1.1 Additional Transport Value Setting Functions.. ..61
3.5.2 Policy Errors.. ..63

3.5.2.1 Policy Error Exception. ..63
3.5.2.2 Policy Error Codes. .63

# Preface

# 1.1 About the Reference Guide

The Reference Guide is the reference for the Spectra ORB C Edition’s Application Programmers Interface (API) function signatures and the standard exceptions.

The Reference Guide is intended to be used with the Spectra ORB C Edition, Product, IDL and User Guides, as well as the other documents included with the product; please refer to the Product Guide for a complete list of documents.

# 1.1.1 Intended Audience

The Reference Guide is intended to be used by developers and engineers working in a distributed computing environment using Spectra ORB.

# 1.1.2 Organisation

The Introduction describes the conventions used for the API definitions.

Chapter 2 , General Information, lists definitions and exception codes.

Chapter 3 , Standard API Reference, describes the functions and exceptions.

# 1.2 Conventions

The conventions listed below are used to guide and assist the reader in understanding this Guide.

![The image displays a warning sign consisting of a red triangle with rounded corners. Inside the triangle is a black exclamation point. A thin black horizontal line runs across the very top of the image.](.spectra-orb-c-edition-reference-guide/a7c52aab5277b0b79754615f602e2f55c972d996908cbe5686f6267e5468602b.jpg)

Item of special significance or where caution needs to be taken

i

Item contains helpful hint or special information.

WIN

Information applies to Windows (e.g. XP, Vista, Windows 7) only.

UNIX

Information applies to Unix based systems (e.g. Solaris) only.

C

C language specific.

C++ language specific.

Java

Java language specific.

Hypertext links are shown as blue italic underlined.

On-Line (PDF) versions of this document: Items shown as cross references to other parts of the document, e.g. 1.3 Contacts on page 7, behave as hypertext links: jump to that section of the document by clicking on the cross reference.

```txt
% Commands or input which the user enters on the command line of their computer terminal
```

Courier, Courier Bold, or Courier Italic fonts indicate programming code. The Courier font can also indicate file names.

Code fragments are shown as small Courier font in shaded boxes:

```txt
NameComponent newName[] = new NameComponent[1];
// set id field to "example" and
// kind field to an empty string

newName[0] = new NameComponent ("example", "");
rootContext.bind (newName, demoObject);
```

Italics and Italic Bold indicate new terms, or emphasise an item.

Sans-serif Bold indicates user-related actions, e.g. File > Save (a sequence of selections from menus, or buttons or check-boxes).

Step 1: one of several steps required to complete a task.

# 1.3 Contacts

PrismTech can be contacted at the following contact points.

# Corporate Headquarters

PrismTech Corporation

400 TradeCenter

Suite 5900

Woburn, MA

01801

USA

Tel: +1 781 569 5819

# European Head Office

PrismTech Limited

PrismTech House

5th Avenue Business Park

Gateshead

NE11 0NG

UK

Tel: +44 (0)191 497 9900

Fax: +44 (0)191 497 9901

Web: http://www.prismtech.com

Technical questions: technical-support@prismtech.com

Sales enquiries: sales@prismtech.com

# 2 General Information

This section provides common mappings, definitions and exceptions.

# 2.1 Common Mappings for IDL Types

Table 1 is provided here for convenience: please refer to the Spectra ORB C Edition IDL Handbook for the complete mapping descriptions.

Table 1 Common IDL Type Definitions

<table><tr><td>Type</td><td>CORBA Type</td></tr><tr><td>unsigned 32 bit integer</td><td>CORBA_unsigned_long</td></tr><tr><td>signed 32 bit integer</td><td>CORBA_long</td></tr><tr><td>8 bit character</td><td>CORBA_char</td></tr><tr><td>signed 16 bit integer</td><td>CORBA_short</td></tr><tr><td>unsigned 16 bit integer</td><td>CORBA_unsigned_short</td></tr><tr><td>unsigned 8 bit integer</td><td>CORBA_octet</td></tr><tr><td>unsigned 8 bit integer</td><td>CORBA_boolean</td></tr><tr><td>unsigned 64 bit integer</td><td>CORBA_unsigned_long_long</td></tr><tr><td>signed 64 bit integer</td><td>CORBA_long_long</td></tr><tr><td>32 bit floating point</td><td>CORBA_float</td></tr><tr><td>64 bit floating point</td><td>CORBA_double</td></tr></table>

# 2.2 Definitions

Table 2 Definitions

<table><tr><td>Item</td><td>Definition</td></tr><tr><td>boolean type</td><td>#define TRUE 1#define FALSE 0</td></tr><tr><td>NIL object</td><td>#define CORBA_OBJECT_NIL NULL</td></tr><tr><td>CORBA ORB</td><td>typedef CORBA_Object CORBA_ORB;</td></tr><tr><td>Exception completion status codes</td><td>typedef CORBA_unsigned_long CORBA_completion_status;#define CORBA_COMPLETE_YES 0#define CORBA_COMPLETE_NO 1#define CORBA_COMPLETE_MAYBE 2</td></tr><tr><td>CORBA system exception</td><td>typedef struct{CORBA_unsigned_long minor;CORBA_completion_status completed;}CORBA_SystemException;</td></tr><tr><td>Major Exception Codes</td><td>#define CORBA_NO_EXCEPTION 0#define CORBA_USER_EXCEPTION 1#define CORBA_SYSTEM_EXCEPTION 2</td></tr><tr><td>ObjectId (strings that identify the object whose reference is required)</td><td>typedef struct{CORBA_unsigned_long _maximum;CORBA_unsigned_long _length;CORBA_ORB_ObjectId * _buffer;}CORBA_ORB_ObjectIdList;</td></tr><tr><td>ORB Id</td><td>typedef char * CORBA_ORBid;</td></tr><tr><td>Any Type</td><td>typedef struct{CORBA_TypeDef_type;void * _value;CORBA_boolean _release;}CORBA_any;</td></tr></table>

# 3 Standard API Reference

This section contains the standard function signatures and exceptions for the ORB’s Application Programmers Interface (API). The section also provides information about policies and the Policy interface which allows access to policies that affect its operation.

i The ORB conforms to the Minimum CORBA Specification v1.0, as aligned to the full CORBA Specification v.2.3, and the OMG’s IDL to C Mapping Specification. Please note that although the ORB conforms to the 2.3 version of the CORBA Specification, it also contains functions and other elements which are:

● included in later (i.e. newer) OMG CORBA specifications
● proprietary to Spectra ORB C Edition

The API descriptions provided in this section will include a note of the CORBA specification version for those functions or elements supported by CORBA Specifications which are newer than the 2.3 version. Functions which are proprietary ORB functions generally have names which are prefixed with EORB\_, for example, EORB\_alloc.

# 3.1 Function Signatures

# 3.1.1 CORBA Module

# 3.1.1.1 Environment

Header: CORBA/Environment.h

# CORBA\_Environment\_\_alloc

```txt
CORBA_Environment * CORBA_Environment_alloc (void)
```

Allocates storage and initializes the CORBA\_Environment structure. The C mapping does not define a way to initialize an environment structure declared on the stack. This can be done by using the memset function to initialize the variable to zero.

# CORBA\_Environment\_\_free

```txt
void CORBA_Environment_free (CORBA_Environment * ev)
```

Frees any storage that was allocated to the CORBA\_Environment structure by the CORBA\_Environment\_\_alloc function.

# 3.1.1.2 Exceptions

Header: CORBA/exception.h

# CORBA\_exception\_as\_any

```txt
CORBA_any * CORBA_exception_as_any (CORBA_Environment * ev)
```

CORBA\_exception\_as\_any returns a pointer to a CORBA\_any containing the exception. If invoked on a CORBA\_Environment which identifies a non-exception, a null pointer is returned. Note that the ownership of the returned pointer does not transfer to the caller; instead the pointer remains valid until CORBA\_exception\_free is called.

# CORBA\_exception\_free

```txt
void CORBA_exception_free (CORBA_Environment * ev)
```

CORBA\_exception\_free clears any exception associated with the the environment and releases any associated storage.

# CORBA\_exception\_id

```txt
CORBA_char * CORBA_exception_id (CORBA_Environment * ev)
```

CORBA\_exception\_id returns a pointer to the character string identifying the exception. The character string contains the repository ID for the exception. If invoked on a environment variable which identifies a non-exception, (\_major equals CORBA\_NO\_EXCEPTION) a null pointer is returned. Note that ownership of the returned pointer does not transfer to the caller; instead, the pointer remains valid until CORBA\_exception\_free is called.

# CORBA\_exception\_set

```txt
void CORBA_exception_set
(
    CORBA_Environment * ev,
    CORBA_exception_type major,
    const CORBA_char * except_repos_id,
    void * param
)
```

CORBA\_exception\_set allows a function implementation to raise an exception. The ev parameter is the environment parameter passed into the function. The caller must supply a value for the major parameter. The value of the major parameter constrains the other parameters in the call as follows:

If the major parameter has a value of CORBA\_NO\_EXCEPTION, then this is a normal outcome to the operation. In this case, both except\_repos\_id and param must be NULL. Note that it is not necessary to invoke CORBA\_exception\_set to indicate a normal outcome; it is the default behaviour if the function simply returns.
For any other value of major it specifies either a user-defined or system exception. The except\_repos\_id parameter is the repository ID representing the exception type. If the exception is declared to have members, the param parameter must be the address of an instance of the exception struct containing the parameters according to the C language mapping, coerced to a void\*. In this case, the exception struct must be allocated using the appropriate T\_\_alloc function, and the CORBA\_exception\_set function adopts the allocated memory and frees it when it no longer needs it. Once the allocated exception struct is passed to CORBA\_exception\_set, the application is not allowed to access it because it no longer owns it. If the exception takes no parameters, param must be NULL.

If the CORBA\_Environment argument to CORBA\_exception\_set already has an exception set in it, that exception is properly freed before the new exception information is set. See the exception example code for typical usage.

CORBA\_exception\_value
```txt
void * CORBA_exception_value (CORBA_Environment * ev)
```

CORBA\_exception\_value returns a pointer to the structure corresponding to this exception. If invoked on a CORBA\_Environment that identifies a non-exception or an exception for which there is no associated information, a null pointer is returned. Note that ownership of the returned pointer does not transfer to the caller; instead, the pointer remains valid until CORBA\_exception\_free is called.

# 3.1.1.3 Fixed Types

Header: CORBA/fixed.h

CORBA\_fixed\_alloc
```txt
void * CORBA_fixed_alloc (CORBA_unsigned_short digits)
```

CORBA\_fixed type storage allocator. Allocates storage for the CORBA\_fixed type.

Parameters

digits number of digits in fixed value

CORBA\_fixed\_fraction\_part
```txt
CORBA_long CORBA_fixed_fraction_part (const void * fixed)
```

Returns the fraction (scale) part of a fixed point decimal.

CORBA\_fixed\_integer\_part
```lisp
CORBA_long CORBA_fixed_integer_part (const void * fixed)
```

Returns the integer (digits) part of a fixed point decimal.

CORBA\_fixed\_set
```txt
void CORBA_fixed_set
(
    void * fixed,
    const CORBA_long ipart,
    const CORBA_long fpart
)
```

Sets the integer (digits) and fractional (scale) part of a fixed point decimal.

Parameters
```txt
fixed pointer to a fixed point decimal
ipart integer (digits) part
fpart fraction (scale) part
```

# CORBA\_fixed\_add

void CORBA\_fixed\_add (void \* rp, const void \* f1p, const void \* f2p)

Performs the addition of 2 fixed-point decimals and stores the result in rp.

# Parameters

```txt
rp pointer to a fixed point decimal (will hold result of operation)
f1p pointer to a fixed point decimal
f2p pointer to a fixed point decimal
```

# CORBA\_fixed\_sub

void CORBA\_fixed\_sub (void \* rp, const void \* f1p, const void \* f2p)

Performs the subtraction of two fixed-point decimals and stores the result in rp.

# Parameters

```txt
rp pointer to a fixed point decimal (will hold result of operation)
f1p pointer to a fixed point decimal
f2p pointer to a fixed point decimal
```

# CORBA\_fixed\_mul

void CORBA\_fixed\_mul (void \* rp, const void \* f1p, const void \* f2p)

Performs the multiplication of two fixed-point decimals and stores the result in rp.

# Parameters

```txt
rp pointer to a fixed point decimal (will hold the result of operation)
f1p pointer to a fixed point decimal
f2p pointer to a fixed point decimal
```

# CORBA\_fixed\_div

void CORBA\_fixed\_div (void \* rp, const void \* f1p, const void \* f2p)

Performs the division of two fixed-point decimals and stores the result in rp.

# Parameters

```txt
rp pointer to a fixed point decimal (will hold the result of operation)
f1p pointer to a fixed point decimal
f2p pointer to a fixed point decimal
```

# 3.1.1.4 General

# CORBA\_free

Header: CORBA.h

void CORBA\_free (void \* ptr)

This function frees memory allocated with one of the ORB allocation functions and calls any associated destructor function. Note the destructor function is called before the memory is actually freed.

# CORBA\_PolicyList\_\_alloc

Header: CORBA/Policy.h

```txt
CORBA_PolicyList * CORBA_PolicyList_alloc (void)
```

Allocate storage for a policy list.

# CORBA\_PolicyList\_allocbuf

Header: CORBA/Policy.h

```cmake
CORBA_Policy * CORBA_PolicyList_allocbuf (CORBA_unsigned_long len)
```

Allocate storage for len elements of a policy list.

# Parameters

len number of elements to allocate storage for

# 3.1.1.5 Sequences

Header: CORBA/sequence.h

# CORBA\_PolicyTypeSeq\_\_alloc

Header: CORBA/Object.h

```txt
CORBA_PolicyTypeSeq * CORBA_PolicyTypeSeq_alloc (void)
```

Allocates storage for a sequence of policy types.

# CORBA\_sequence\_set\_release

```txt
void CORBA_sequence_set_release (void * sequence, CORBA_boolean release)
```

Sequence types support the notion of ownership of their \_buffer members. By setting a release flag in the sequence when a buffer is installed, programmers can control ownership of the memory pointed to by \_buffer. The location of this release flag is implementation-dependent. The two ORB-supplied functions allow for the setting and checking of the sequence release flag:

CORBA\_sequence\_set\_release can be used to set the state of the release flag. If the flag is set to TRUE, the sequence effectively "owns" the storage pointed to by \_buffer; if FALSE, the programmer is responsible for the storage. If, for example, a sequence is returned from an operation with its release flag set to FALSE, calling CORBA\_free on the returned sequence pointer will not deallocate the memory pointed to by \_buffer. Before calling CORBA\_free on the \_buffer member of a sequence directly, the programmer should check the release flag using CORBA\_sequence\_get\_release. If it returns FALSE, the programmer should not invoke CORBA\_free on the \_buffer member; doing so produces undefined behaviour. Also, passing a null pointer or a pointer to something other than a sequence type to either CORBA\_sequence\_set\_release or CORBA\_sequence\_get\_release produces undefined behaviour.

CORBA\_sequence\_set\_release should only be used by the creator of a sequence. If it is not called for a given sequence instance, then the default value of the release flag for that instance is FALSE.

Two sequence types are the same type if their sequence element type and size arguments are identical.

# 3.1.1.6 Strings

Header: CORBA/string.h

# CORBA\_string\_alloc

```cmake
CORBA_char * CORBA_string_alloc (CORBA_unsigned_long length)
```

Strings are dynamically allocated using this function, which allocates len+1 bytes (length of the string plus the NULL termination character). The client should never pass an inout string parameter that was not allocated using CORBA\_string\_alloc. The client is responsible for freeing the allocated storage using CORBA\_string\_free, regardless of whether or not a reallocation was necessary.

Strings allocated in this manner are freed using CORBA\_string\_free.

# CORBA\_string\_dup

```c
CORBA_char * CORBA_string_dup (CORBA_char * str)
```

The string\_dup function dynamically allocates enough space to hold a copy of its string argument, including the NULL character, copies its string argument into that memory, and returns a pointer to the new string. If allocation fails, a null pointer is returned.

# CORBA\_string\_free

```txt
void CORBA_string_free (CORBA_char * str)
```

Frees the storage for a string allocated by the CORBA\_string\_alloc function.

# 3.1.1.7 Any Interface

Header: CORBA/any.h

# CORBA\_any\_alloc

```txt
CORBA_any * CORBA_any_alloc (void)
```

This allocates a new any type. The memory for this is freed by calling CORBA\_free.

# CORBA\_any\_get\_release

```cmake
CORBA_boolean CORBA_any_get_release (CORBA_any * any)
```

Gets the ownership of the value contained within the any. See CORBA\_any\_set\_release below for details.

# CORBA\_any\_set\_release

```txt
void CORBA_any_set_release (CORBA_any * any, CORBA_boolean release)
```

CORBA\_any\_set\_release can be used to set the state of the release flag. If the flag is set to TRUE, then the any owns the memory storage pointed to by \_value and must therefore manage it; if FALSE, then the programmer is responsible for the memory storage. For example, if an any is returned from an operation with its release flag set to FALSE, then calling CORBA\_free on the returned any will not deallocate the memory pointed to by \_value. Before calling CORBA\_free on the \_value member of an any directly, then the programmer should check the release flag using CORBA\_any\_get\_release. If it returns FALSE, then the programmer should not invoke CORBA\_free on the \_value member; doing so produces undefined behaviour. Also, passing a null pointer to either CORBA\_any\_set\_release or CORBA\_any\_get\_release produces undefined behaviour. If CORBA\_any\_set\_release is never called for a given instance of any, the default value of the release flag for that instance is FALSE.

# 3.1.1.8 Object Interface

Header: CORBA/Object.h

CORBA\_Object\_duplicate
```cmake
CORBA_Object CORBA_Object_duplicate (
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

Because object references are opaque and ORB-dependent, it is not possible for clients or implementations to allocate storage for them. Therefore, there are operations defined to copy or release an object reference. If more than one copy of an object reference is needed, the client may create a duplicate. Note that the object implementation is not involved in creating the duplicate, and that the implementation cannot distinguish whether the original or a duplicate was used in a particular request.

When the object is no longer needed, you must call CORBA\_Object\_release to release it.

CORBA\_Object\_get\_client\_policy
```cmake
CORBA_Policy CORBA_Object_get_client_policy(
    CORBA_Object obj,
    CORBA_PolicyType policy_type,
    CORBA_Environment * ev
)
```

Returns the effective overriding Policy for the object reference. The effective override is obtained by first checking for an override of the given PolicyType at the Object scope, then at the Current scope, and finally at the ORB scope. If no override is present for the requested PolicyType, a system-dependent default value for that PolicyType may be returned. A NULL Policy reference may also be returned to indicate that there is no default for the policy. Portable applications are expected to set the desired “defaults” at the ORB scope since default Policy values are not specified.

CORBA\_Object\_get\_policy
```txt
CORBA_Policy CORBA_Object_get_policy
```

```txt
(
CORBA_Object obj,
CORBA_PolicyType policy_type,
CORBA_Environment *ev
)
```

INV\_POLICY is raised with standard minor code 1. The absence of a Policy value in the IOR implies that any legal value may be used. Invoking non\_existent on an object reference prior to get\_policy ensures the accuracy of the returned effective Policy. If get\_policy is invoked prior to the object reference being bound, a compliant implementation shall attempt a binding and then return the effective Policy. If the binding attempt fails it shall pass through the system exception returned from the binding attempt. Note that the effective Policy may change from invocation to invocation due to transparent rebinding.

# Parameters

policy\_type The type of policy to be obtained.

CORBA\_Object\_get\_policy\_overrides
```txt
CORBA_PolicyList * CORBA_Object_get_policy_overrides (
    CORBA_Object obj,
    CORBA_PolicyTypeSeq * ts,
    CORBA_Environment * ev
)
```

Returns the list of Policy overrides (of the specified policy types) set at the Object scope. If the specified sequence is empty, all Policy overrides at this scope will be returned. If none of the requested PolicyTypes are overridden at the Object scope, an empty sequence is returned.

CORBA\_Object\_is\_equivalent
```txt
CORBA_boolean CORBA_Object_is_equivalent (
    CORBA_Object obj,
    CORBA_Object other_object,
    CORBA_Environment * ev
)
```

The is\_equivalent operation is used to determine if two object references are equivalent, in so far that the ORB can easily determine if the object reference passed as the obj parameter is equivalent to reference passed as the other\_object parameter. then TRUE is returned FALSE is returned if the are not equivalent.

If two object references are identical, they are equivalent. Two different object references which refer to the same object are also equivalent.

ORBs are allowed, but not required, to attempt to determine if two distinct object references refer to the same object. In general, the existence of reference translation and encapsulation, in the absence of an omniscient topology service, can make such determination impractically expensive. In other words, a FALSE return value may only indicating that the object references are distinct, but not necessarily that the objects are distinct.

CORBA\_Object\_is\_a
```txt
CORBA_boolean CORBA_Object_is_a (
```

```txt
CORBA_Object obj,
char * id,
CORBA_Environment * ev
)
```

Facilitate maintaining type-safety for object references over the scope of an ORB.

The id is a string denoting a shared type identifier. The operation returns true if the object is really an instance of that type, including if that type is an ancestor of the most derived type of that object. Determining whether an object's type is compatible with the id may require contacting a remote ORB or interface repository. Such an attempt may fail at either the local or the remote end. If is\_a cannot make a reliable determination of type compatibility due to failure, then it raises an exception in the calling application code. This enables the application to distinguish among the TRUE, FALSE, and indeterminate cases.

This operation exposes to application programmers functionality that must already exist in ORBs which support type safe narrow and allows programmers working in environments that do not have compile time type checking to explicitly maintain type safety.

Note that this operation is not supported under strict minimum CORBA or the CORBA/e compact profile.

CORBA\_Object\_is\_nil
```cmake
CORBA_boolean CORBA_Object_is_nil (
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

Returns TRUE if the object reference does not refer to a servant.

CORBA\_Object\_is\_non\_existent
```cmake
CORBA_boolean CORBA_Object_non-existent (
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

Returns TRUE if the object implementation no longer exists. Note that this operation is not supported under strict minimum CORBA or the CORBA/e compact profile.

CORBA\_Object\_get\_orb
```cmake
CORBA_ORB CORBA_Object_non-existent (
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

Returns the ORB associated with an object. This will always be the ORB singleton.

CORBA\_Object\_release
```c
void CORBA_Object_release (
    CORBA_Object obj,
    CORBA_Environment * ev
```

)

Because object references are opaque and ORB-dependent, it is not possible for clients or implementations to allocate storage for them. Therefore, there are operations defined to copy or release an object reference.

When an object reference is no longer needed by a program, its storage may be reclaimed by use of the release operation. Note that the object implementation is not involved, and that neither the object itself nor any other references to it are affected by the release operation.

CORBA\_Object\_set\_policy\_overrides
```txt
CORBA_Object CORBA_Object_set_policy_overrides (
    CORBA_Object obj,
    CORBA_PolicyList * policies,
    CORBA_SetOverrideType set_add,
    CORBA_Environment * ev
)
```

The set\_policy\_overrides operation returns a new object reference with the new policies associated with it. It takes two input parameters. The policies parameter is a sequence of references to Policy objects. The parameter set\_add parameter indicates whether these policies should be added onto any other overrides that already exist (ADD\_OVERRIDE) in the object reference, or they should be added to a clean override free object reference (SET\_OVERRIDE). This operation associates the policies passed in the policies parameter with a newly created object reference that it returns. Only certain policies that pertain to the invocation of an operation at the client end can be overridden using this operation. Attempts to override any other policy will result in the raising of the CORBA\_NO\_PERMISSION exception.

# Parameters

policies A sequence of Policy objects that are to be associated with the new copy of the object reference returned by this operation. If the sequence contains two or more Policy objects with the same PolicyType value, the operation raises the standard system exception BAD\_PARAM with minor code 30.

set\_add Whether the association is in addition to (ADD\_OVERRIDE) or as a replacement of (SET\_OVERRIDE) any existing overrides already associated with the object reference. If the value of this parameter is SET\_OVERRIDE, the supplied policies completely replace all existing overrides associated with the object reference. If the value of this parameter is ADD\_OVERRIDE, the supplied policies are added to the existing overrides associated with the object reference, except that if a supplied Policy object has the same PolicyType value as an existing override, the supplied Policy object replaces the existing override.

CORBA\_Object\_validate\_connection
```txt
CORBA_boolean CORBA_Object_validate_connection (
    CORBA_Object obj,
    CORBA_PolicyList ** inconsistent_policies,
    CORBA_Environment * ev
)
```

Function to validate connection with respect to effective policies. Returns the value TRUE if the current effective policies for the Object will allow an invocation to be made. If the object reference is not yet bound, a binding will occur as part of this operation. If the object reference is already bound, but current policy overrides have changed or for any other reason the binding is no longer valid, a rebind will be attempted regardless of the setting of any RebindPolicy override.

If the current effective policies are incompatible, the out parameter inconsistent\_policies contains those policies causing the incompatibility (not exhaustive). Returns the value FALSE if the current effective policies would cause an invocation to raise a system exception.

Parameters

inconsistent\_policies policy list

# 3.1.1.9 ORB Interface

Header: CORBA/ORB.h

Types
```c
typedef char * CORBA_ORB_ObjectId
typedef CORBA_Object CORBA_ORB
typedef CORBA_sequence_string CORBA_ORB_ObjectIdList
```

CORBA\_ORB\_create\_policy
```txt
CORBA_Policy CORBA_ORB_create_policy (
    CORBA_ORB orb,
    CORBA_PolicyType type,
    CORBA_any * any,
    CORBA_Environment * ev
)
```

The ORB operation create\_policy can be invoked to create new instances of policy objects of a specific type with a specified internal state. If create\_policy fails to instantiate a new Policy object due to its inability to interpret the requested type and content of the policy, then it raises one of the PolicyError exceptions listed under Policy Error Codes on page 57.

Parameters

type The type of policy object to be created

any Value for setting the initial state of the policy object that is created.

CORBA\_ORB\_destroy
```txt
void CORBA_ORB_destroy (CORBA_ORB orb, CORBA_Environment * ev)
```

This operation destroys the ORB and enables resources to be reclaimed. The destroy function destroys the memory associated with the CORBA\_Environment. This function should only be called once in an application when the ORB is no longer required since Spectra ORB does not currently support multiple ORB instances.

CORBA\_ORB\_shutdown
```txt
void CORBA_ORB_shutdown (
    CORBA_ORB orb,
```

```txt
CORBA_boolean wait_for_completion,
CORBA_Environment * ev
)
```

This operation shuts down the ORB, deactivating the POA if installed. If the

wait\_for\_completion parameter is set to TRUE then this function will block until all pending requests on any installed POAs are completed.

CORBA\_ORB\_init
```txt
CORBA_ORB CORBA_ORB_init
(
    int * argc,
    char ** argv,
    CORBA_ORBid orb_identifier,
    CORBA_Environment * ev
)
```

Create and initialize a new ORB instance. This function may be called whenever a reference to the ORB is required. The implementation of this function only supports a single ORB instance, since Spectra ORB is a minimum- CORBA ORB, so the orb\_identifier argument is ignored. The first call to this function will create and initialize the singleton ORB instance, all subsequent calls will simply return a reference to this singleton ORB.

The C mapping for ORB\_init deviates from the OMG IDL PIDL in the way it handles the arg\_list parameter. This is intended to provide a meaningful PIDL definition of the initialization API, which has a natural C binding. To this end, the arg\_list structure is replaced with argv and argc parameters.

The argv parameter is defined as an array of strings (char\*\*) and the number of strings in the array is passed in the argc (int\*) parameter.

If an empty ORBid string is used then argc arguments can be used to determine which ORB should be returned. This is achieved by searching the argv parameters for one tagged ORBid, for example, -ORBid "ORBid\_example". If an empty ORBid string is used and no ORB is indicated by the argv parameters, the default ORB is returned.

Regardless of whether an empty or non-empty ORBid string is passed to ORB\_init, the argv arguments are examined to determine if any ORB parameters are given. If a non-empty ORBid string is passed to ORB\_init, all -ORBid parameters in the argv are ignored. All other -ORB&lt;suffix&gt; parameters may be of significance during the ORB initialization process.

For C, the order of consumption of argv parameters may be significant to an application. To ensure that applications are not required to handle argv parameters they do not recognize, the ORB initialization function must be called before the remainder of the parameters are consumed. Therefore, after the ORB\_init call, the argv and argc parameters will have been modified to remove the ORB understood arguments. It is important to note that the ORB\_init call can only reorder or remove references to parameters from the argv list; this restriction is made to avoid potential memory management problems caused by trying to free parts of the argv list or extending the argv list of parameters.

# ORB Initialization Arguments

The following arguments can be passed as command-line parameters into the CORBA\_ORB\_init function in order to initialize the ORB.

```txt
-ORBInitRef &lt;name&gt;=&lt;ior&gt;
Specifies an object reference that can be resolved by the ORB
resolve_initial_references function. The &lt;name&gt; argument is the name by which the reference will be resolved and the &lt;ior&gt; argument is an object reference URL.
```

```txt
-ORBDefaultInitRef &lt;name&gt;
Specifies a default name prefix that is applied to a name resolved by the ORB resolve_initial_references function.
```

```txt
- ORBid &lt;name&gt;
Set the ORB name. The 'orb_identifier' argument will override this value if set.
```

```txt
-ORBFT
Enable client side fault tolerant semantics. If this flag is set and a client connection fails with a TRANSIENT, COMM_FAILURE, NO_RESPONSE or OBJ_ADAPTER system exception then the connection is re-bound and an attempt made to re-invoke the call unless a COMPLETED_MAYBE completion status was returned (to ensure at most once semantics).
```

```txt
-ORBServerId &lt;name&gt;
Specifies an ORB server identity that is added to object keys created for persistent object references. This allows the ORB to distinguish between object references created in different processes with the same POA name and object id.
```

```txt
-ORBSyncServer Sets the default messaging sync scope for one way calls, to sync with server (only return when server has received request).
```

```txt
-ORBSyncTarget Sets the default messaging sync scope for one way calls, to sync with target (only return when servant has received request).
```

```txt
- ORBLogLevel &lt;debug | stats | warn | error | fatal&gt;
Sets the default ORB logging level. If no log level is specified the default level is for warnings and above (logging is only available in debug builds).
```

```txt
-ORBConfigFile &lt;file&gt;
Specifies a file from which other ORB initialization arguments can be read. Each initialization argument should be on a separate line of the file and a single character should be used to separate arguments and their values. For example:
```

```txt
-ORBLogLevel:DEBUG
-ORBServerId:Steve
-ORBDefaultInitRef:com.prismt
```

```txt
-ORBNoColocation
Specifies that requests to co-located objects are made via a transport and not via the normal, more optimal, direct request.
```

```txt
-ORBHost
Specifies the host name or IP address to be used for IIOP/DIOP object profiles. Useful for multi-homed hosts where multiple network interfaces are supported with different addresses.
```

```txt
-ORBInterop
Specifies that the ORB will be interoperating with a foreign ORB. This disables the use of any ORB specific GIOP components, such as service contexts.
```

```txt
-ORBProtocol &lt;protocol&gt;
Specifies the default protocol to use when an IOR contains multiple profiles. The &lt;protocol&gt; string is the name of the protocol to select, for example 'uiop' or 'iiop'. If not set, then the ORB by default will always select the IIOP protocol.
```

-ORBListenEndpoints &lt;list&gt;

Specifies the default set of protocol listen endpoints. These are specified as a comma separated list of endpoint identifiers. For example:

```txt
iiop://&lt;host&gt;:&lt;port&gt;,diop:&lt;host&gt;:&lt;port&gt;,uiop:&lt;file&gt;
```

-ORBPOAEndpoints &lt;list&gt;

Specifies transport listener endpoints on a per POA basis. These are specified as a comma separated list of endpoint identifiers. The syntax is the same as for standard endpoints (see above), except that the POA name is applied as a prefix with a colon separator. For example:

```txt
NameService:iiop:&lt;host&gt;:&lt;port&gt;
```

-ORBThreadPoolStack &lt;value&gt;

Sets the default stack size, in bytes, for threads created by the ORB. By default the stack size for created threads is determined by the operating system.

-ORBThreadPoolPriority &lt;value&gt;

Sets the default native priority for threads created by the ORB. By default threads are created without a set priority.

-ORBThreadPoolSize &lt;value&gt;

Sets the initial size of a thread pool (number of threads created on initialization). By default this is set to one so the thread pool is initialized with a single thread.

-ORBThreadPoolMax &lt;value&gt;

Sets the maximum size of a thread pool. By default this is zero so there is no maximum for the number of threads that may be created in a pool.

-ORBThreadPoolQueue &lt;value&gt;

Sets the maximum number of requests that can be queued for processing by a thread pool. By default this is zero so there is no maximum for the number of jobs that may be queued for processing by the thread pool.

-ORBConnCacheSize &lt;value&gt;

Sets the maximum size of the client transport connection cache. Connection caching is disabled if this is set to zero or the real-time ORB is installed. The default maximum for the connection cache is four.

-ORBPrivateServerConn

Sets the default server connection model to private.

-ORBPrivateClientConn

Sets the default client connection model to private. By default, client connections are shared unless the realtime ORB has been installed.

-ORBListenerPriority &lt;priority&gt;

When running in realtime mode sets the default priority for transport listener threads. The priority value should be a valid CORBA priority (0 – 32767).

-ORBRequestTimeout &lt;timeout&gt;

Set the timeout (in milliseconds), used when the ORB tries makes a request. By default this is not set and the ORB will wait for ever for a request to complete.

-ORBConnectTimeout &lt;timeout&gt;

Set the timeout (in milliseconds), used when the ORB tries to establish a new client side transport connection. By default this is not set and the ORB will wait for ever for a connection to be established.

-ORBFragmentSize &lt;size&gt;

This enables GIOP fragmentation for messages above the specified size. The fragment size includes the GIOP header so the minimum for this value is 24. This will be the maximum request size sent to the underlying transport so can be used where a transport implementation may have a fixed maximum request size.

-ORBRegistry &lt;registries&gt;

This argument configures registries used for the ORB register\_initial\_reference operation. Supported registries currently include standard output and file. See the 'Object Reference Resolution' section of the user guide for more detail.

-ORBLocate

When an object reference is first used this flag makes the ORB make an initial GIOP locate request as opposed to a normal request. This can be useful when working with an implementation repository or other location agent, where the endpoint in the object reference in not for the eventual target server. This behaviour can also be implemented on a per interface basis by compiling with the '-locate' IDL compiler flag.

-ORBCorbaloc

When converting an object reference to a string using the object\_to\_string operation this flag causes the generation of a corbaloc format string.

-ORBReuseAddr

When creating a socket based endpoint (for example for IIOP or DIOP protocols), this flag sets the socket reuse address policy. Is normally of use when running a server on fixed endpoints, in the situation where a server is restarting and the listener socket may not have timed out.

-ORBKeepAlive

When using a socket based transport such as IIOP this flag sets the socket keep alive policy on connections. Setting this option allows connections to detect when a remote connection has failed and generate an exception for clients and close the connection for servers.

-ORBCloseClientConn

When a client side transport connection is closed and this flag is set the ORB will send a GIOP::CloseConnection message.

-ORBCloseServerConn

When a server side transport connection is closed and this flag is set the ORB will send a GIOP::CloseConnection message.

-ORBFixedPOA

If this flag is set then all servant lookups in a POA are unlocked, giving faster request handling. This should not be enabled if servants are dynamically added or removed from a POA after it has been activated.

-ORBShutdownDelay &lt;milliseconds&gt;

When the ORB is destroyed, this sets the delay before the ORB run operation returns. This can be useful when memory profiling the ORB to allow time for pool threads to exit, to avoid the generation of spurious memory leak reports. The default value for this delay can vary depending on the operating system, although for most systems the default value is 400 milliseconds. To check for the value for a particular system look for EORB\_ORB\_SHUTDOWN\_DELAY in the system specific include directory under include/eOrbC/os.

-ORBClientCDRBufferSize &lt;bytes&gt;

This value sets the initial size for the CDR marshalling buffer for the construction of client requests. The buffer will be reused to receive a reply message. The default value is 512 and the minimum value is 256. Note that the maximum size of CDR buffers is shown when ORB logging is set to report stats.

-ORBServerCDRBufferSize &lt;bytes&gt;

This value sets the initial size for the CDR marshalling buffer for a server to receive requests. The buffer will be reused to construct reply messages. The default value is 512 and the minimum value is 256. Note that the maximum size of CDR buffers is shown when ORB logging is set to report stats.

-ORBCDRBufferResize &lt;number&gt;

When a CDR marshalling buffer needs to be increased in size the new size will be rounded up to a power of 2. This value sets the required power of 2. The default value is 12 (allocating in 4K byte chunks) and the maximum value is 24.

-ORBZeroCopyThreshold &lt;bytes&gt;

If a transport supports zero copy then this value sets the threshold size below which data is copied as opposed to zero copied. For small data sizes, zero copying may be less performant than simply copying.

-ORBZeroCopyBuffMax &lt;number&gt;

If a transport supports zero copy then this value sets the maximum number of data buffers that will be presented by the ORB to the transport. Some transports may have a limit on the number of zero copy buffers they can handle.

-ORBPOAPersistent

Sets the default lifespan policy for the root POA to be persistent.

-ORBPOAMultipleId

Sets the default id uniqueness policy for the root POA to be multiple id.

-ORBPOAUserId

Sets the default id assignment policy for the root POA to be user id.

CORBA\_ORB\_list\_initial\_services
```txt
CORBA_ORB_ObjectIdList * CORBA_ORB_list_initial_services (
    CORBA_ORB orb,
    CORBA_Environment * ev
)
```

This function returns an ObjectIdList of the object IDs of those objects which are listed in the initial references list. ObjectIdList is a sequence of object identifiers and are typed as strings. Objects whose IDs are in this list can be resolved using the resolve\_initial\_references function.

See CORBA\_ORB\_resolve\_initial\_references below.

CORBA\_ORB\_object\_to\_string
```txt
CORBA_char * CORBA_ORB_object_to_string (
    CORBA_ORB orb,
    const CORBA_Object orb,
    CORBA_Environment * ev
)
```

Returns a string representation (a stringified IOR) of a CORBA object’s IOR. This string can be persisted and is one of the methods which are available for publishing or making an object available to other objects. Also see CORBA\_ORB\_string\_to\_object. The generated IOR string will be of generic format (starting with “IOR:”) unless the orb argument is passed as NULL, in which case a corbaloc format string (starting with “corbaloc:”) will be generated. This latter case is Spectra ORB-specific behaviour.

CORBA\_ORB\_register\_initial\_reference
```txt
void CORBA_ORB_register_initial_reference (
    CORBA_ORB orb,
    const char * name,
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

Adds a unique named object to the list used by resolve\_initial\_references for resolving named objects. See CORBA\_ORB\_resolve\_initial\_references below.

If a reference for a local servant is registered as an initial reference, then this name can be used as part of a corbaloc format object reference string to resolve the service. For example the name service can be resolved via the following type URI:

```html
corbaloc:iiop:&lt;host&gt;:&lt;port&gt;/NameService
```

The ORB also supports pluggable registries via the '-ORBRegistry' ORB initialization argument. This allows a registered reference to be written to a number of formats. Currently supported registries include file and standard output. See the 'Object Reference Resolution' section of the user guide for more detail.

If an attempt is made to register a reference using a name that has already been registered then an InvalidName exception is thrown unless the service name ends in “Service” in which case the old registration will be overwritten with the new.

CORBA\_ORB\_resolve\_initial\_references
```txt
CORBA_Object CORBA_ORB_resolve_initial_references (
    CORBA_ORB orb,
    const char * identifier,
    CORBA_Environment * ev
)
```

Returns the object reference for objects or service listed in an initial references list. This list uses object IDs (strings) to identify the objects. The ids listed is only for a subset of standard CORBA core objects, services and other, non-standard objects. The objects listed in the initial references list depend on the ORB’s configuration. Each standard CORBA object and service has a reserved ID.

The reserved IDs (type ObjectId) for the CORBA core objects are:

```txt
RootPOA
POACurrent
InterfaceRepository
PolicyManager
PolicyCurrent
```

The reserved IDs (type ObjectId) for the CORBA services are:

```txt
NameService
EventService
```

The default ORB configuration supports only the RootPOA, POACurrent, PolicyManager and PolicyCurrent objects. Also see CORBA\_ORB\_register\_initial\_reference .

This function will also resolve objects registered via an -ORBInitRef ORB initialisation argument or explicitly via the ORB register\_initial\_reference function.

CORBA\_ORB\_run
```txt
void CORBA_ORB_run (CORBA_ORB orb, CORBA_Environment * ev)
```

Instructs the ORB to process ORB events (requests and replies). Does not return until the ORB is shutdown. Calling run from the main thread is useful to ensure that the process does not exit until the ORB is shut down.

CORBA\_ORB\_string\_to\_object
```txt
CORBA_Object CORBA_ORB_string_to_object (
    CORBA_ORB orb,
    const CORBA_char * str,
    CORBA_Environment * ev
)
```

Uses a string containing a stringified IOR, the str parameter, to return the IOR for the object specified by the orb parameter. Throws BAD\_PARAM exception on failure.

The orb parameter can be NULL, this is necessary when a fully initialized ORB is not available when using PortableInterceptor\_ORBInitInfo\_register\_initial\_reference in a pre\_init initializer of a PortableInterceptor\_ORBInitializer.

# 3.1.1.10 Policy Interface

CORBA\_Policy\_\_get\_policy\_type
```cmake
CORBA_PolicyType CORBA_Policy__get_policy_type (
    CORBA_Policy obj,
    CORBA_Environment * ev
)
```

Returns the constant value of type PolicyType that corresponds to the type of the policy object obj.

CORBA\_Policy\_copy
```txt
CORBA_Policy CORBA_Policy_copy (CORBA_Policy obj, CORBA_Environment * ev)
```

Creates a copy of the policy object obj. The copy does not retain any relationships that the policy had with any domain or object.

CORBA\_Policy\_destroy
```c
void CORBA_Policy_destroy (CORBA_Policy obj, CORBA_Environment *ev)
```

Destroys the policy object obj. It is the responsibility of the policy object to determine whether it can be destroyed.

# 3.1.1.11 PolicyCurrent Interface

Header: CORBA/Policy.h

CORBA\_PolicyCurrent\_get\_policy\_overrides
```cmake
CORBA_PolicyList * CORBA_PolicyCurrent_get_policy_overrides (
    CORBA_PolicyCurrent obj,
    CORBA_PolicyTypeSeq * ts,
    CORBA_Environment * ev
)
```

Returns policies with thread-level scope.

See CORBA\_PolicyManager\_get\_policy\_overrides for details.

CORBA\_PolicyCurrent\_set\_policy\_overrides
```cmake
void CORBA_PolicyCurrent_set_policy_overrides (
    CORBA_PolicyCurrent obj,
    CORBA_PolicyList * policies,
    CORBA_SetOverrideType set_add,
    CORBA_Environment *ev
)
```

Modifies policies with Thread-level scope.

See CORBA\_PolicyManager\_set\_policy\_overrides for details.

# 3.1.1.12 PolicyManager Interface

Header: CORBA/Policy.h

CORBA\_PolicyManager\_get\_policy\_overrides
```cmake
CORBA_PolicyList * CORBA_PolicyManager_get_policy_overrides (
    CORBA_PolicyManager obj,
    CORBA_PolicyTypeSeq * ts,
    CORBA_Environment * ev
)
```

Returns a PolicyList containing the overridden Policies for the requested PolicyTypes. If the specified sequence is empty, then all Policy overrides at this scope will be returned. If none of the requested PolicyTypes are overridden at the target PolicyManager, then an empty sequence is returned. This accessor returns only those Policy overrides that have been set at the specific scope corresponding to the target PolicyManager (no evaluation is done with respect to overrides at other scopes).

# Parameters

ts A sequence of overridden policy types identifying the policies that are to be retrieved.

CORBA\_PolicyManager\_set\_policy\_overrides
```txt
void CORBA_PolicyManager_set_policy_overrides (
```

```txt
CORBA_PolicyManager obj,
CORBA_PolicyList * policies,
CORBA_SetOverrideType set_add,
CORBA_Environment * ev
)
```

Modifies the current set of overrides with the requested list of Policy overrides.

The policies parameter is a sequence of references to Policy objects. The set\_add parameter indicates whether these policies should be added onto any other overrides that already exist (ADD\_OVERRIDE) in the PolicyManager, or they should be added to a clean PolicyManager free of any other overrides (SET\_OVERRIDE). Invoking set\_policy\_overrides with an empty sequence of policies and a mode of SET\_OVERRIDE removes all overrides from a PolicyManager. Only certain policies that pertain to the invocation of an operation at the client end can be overridden using this operation. Attempts to override any other policy will result in the raising of the CORBA\_NO\_PERMISSION exception. If the request would put the set of overriding policies for the target PolicyManager in an inconsistent state, no policies are changed or added, and the InvalidPolicies exception is raised. There is no evaluation of compatibility with policies set within other PolicyManagers.

# Parameters

policies A sequence of Policy objects that are to be associated with the PolicyManager object. If the sequence contains two or more Policy objects with the same PolicyType value, the operation raises the standard system exception BAD\_PARAM with standard minor code 30.

set\_add Whether the association is in addition to (ADD\_OVERRIDE) or as a replacement of (SET\_OVERRIDE) any existing overrides already associated with the PolicyManager object. If the value of this parameter is SET\_OVERRIDE, the supplied policies completely replace all existing overrides associated with the PolicyManager object. If the value of this parameter is ADD\_OVERRIDE, the supplied policies are added to the existing overrides associated with the PolicyManager object, except that if a supplied Policy object has the same PolicyType value as an existing override, the supplied Policy object replaces the existing override.

# 3.1.1.13 TypeCode Interface

Header: CORBA/TypeCode.h

# CORBA\_TypeCode\_BadKind\_\_alloc

```txt
CORBA_TypeCode_BadKind * CORBA_TypeCode_BadKind_alloc (void)
```

# CORBA\_boolean CORBA\_TypeCode\_equal

```cmake
CORBA_boolean CORBA_TypeDefCode_equal (
    CORBA_TypeDefCode tc1,
    CORBA_TypeDefCode tc2,
    CORBA_Environment * ev
)
```

CORBA\_TypeCode\_equal determines if two TypeCodes describe the same basic abstract data type. Equivalent TypeCodes produce the same results when TypeCode methods are invoked on them.

# CORBA\_TypeCode\_duplicate

```txt
void CORBA_TypeCode_duplicate (CORBA_TypeCode tc)
```

Creates a duplicate instance of CORBA\_TypeCode.

CORBA\_TypeCode\_id
```cmake
CORBA_RepositoryId CORBA_TypeCode_id (
    CORBA_TypeCode tc,
    CORBA_Environment * ev
)
```

Returns the repository id of the type code.

CORBA\_TypeCode\_kind
```cmake
CORBA_TCKind CORBA_TypeCode_kind (
    CORBA_TypeCode tc,
    CORBA_Environment * ev
)
```

Returns the TCKind value of a type code. The return value describes what kind of type is described by the type code. The TCKind value also determines which other operations on the type code you can call to extract more details.

CORBA\_TypeCode\_name
```txt
CORBA_Identifier CORBA_TypeCode_name (
    CORBA_TypeCode tc,
    CORBA_Environment * ev
)
```

Returns the identifier of the type code.

# 3.1.1.14 LocalObject Interface

Header: CORBA/LocalObject.h

CORBA\_LocalObject\_\_add\_ref
```cmake
CORBA_LocalObject_add_ref (CORBA_LocalObject obj)
```

Adds a reference to an allocated instance of a local object.

CORBA\_LocalObject\_\_remove\_ref
```cmake
CORBA_LocalObject__remove_ref (CORBA_LocalObject obj)
```

Removes a reference from an allocated instance of a local object and frees the instance if the reference count reaches zero.

# 3.1.1.15 DataInputStream Value Type

Header CORBA/DataInputStream.h

CORBA\_DataInputStream\_\_alloc

```cmake
CORBA_DataInputStream CORBA_DataInputStream__alloc (CORBA_DataOutputStream os)
```

Creates a data output stream from a data input stream. The contents of the output stream are copied into the newly created input stream.

CORBA\_DataInputStream\_read\_boolean
```cmake
CORBA_boolean CORBA_DataInputStream_read_boolean (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a boolean value from a data input stream.

CORBA\_DataInputStream\_read\_char
```cmake
CORBA_char CORBA_DataInputStream_read_char (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a char value from a data input stream.

CORBA\_DataInputStream\_read\_octet
```cmake
CORBA_octet CORBA_DataInputStream_read_octet (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads an octet value from a data input stream.

CORBA\_DataInputStream\_read\_short
```cmake
CORBA_short CORBA_DataInputStream_read_short (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a short value from a data input stream.

CORBA\_DataInputStream\_read\_ushort
```cmake
CORBA_unsigned_short CORBA_DataInputStream_read_ushort (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads an unsigned short value from a data input stream.

CORBA\_DataInputStream\_read\_long

```cmake
CORBA_long CORBA_DataInputStream_read_long (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a long value from a data input stream.

CORBA\_DataInputStream\_read\_ulong
```cmake
CORBA_unsigned_long CORBA_DataInputStream_read_ulong
(
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads an unsigned long value from a data input stream.

CORBA\_DataInputStream\_read\_string
```txt
char * CORBA_DataInputStream_read_string (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a string value from a data input stream.

CORBA\_DataInputStream\_read\_float
```cmake
CORBA_float CORBA_DataInputStream_read_float (
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a float value from a data input stream.

CORBA\_DataInputStream\_read\_double
```cmake
CORBA_double CORBA_DataInputStream_read_double(
    CORBA_DataInputStream is,
    CORBA_Environment * ev
)
```

Reads a double value from a data input stream.

CORBA\_DataInputStream\_read\_octet\_array
```txt
CORBA_double CORBA_DataInputStream_read_octet_array (
    CORBA_DataInputStream is,
    CORBA_OctetSeq * seq,
    CORBA_unsigned_long offset,
    CORBA_unsigned_long length,
    CORBA_Environment * ev
)
```

Reads an octet array from a data input stream into an octet sequence. The length argument is the size of the octet array to copy and the offset argument is the offset within the sequence to which the array is copied. The sequence buffer is extended if required.

# 3.1.1.16 DataOutputStream Value Type

Header CORBA/DataOutputStream.h

CORBA\_DataOutputStream\_\_alloc
```txt
CORBA_DataOutputStream CORBA_DataOutputStream_alloc (void)
```

Creates a data output stream.

CORBA\_DataOutputStream\_write\_boolean
```cmake
void CORBA_DataOutputStream_write_boolean(
    CORBA_DataOutputStream os,
    CORBA_boolean value,
    CORBA_Environment * ev
)
```

Writes a boolean value to a data output stream.

CORBA\_DataOutputStream\_write\_char
```txt
void CORBA_DataOutputStream_write_char(
    CORBA_DataOutputStream os,
    CORBA_char value,
    CORBA_Environment * ev
)
```

Writes a char value to a data output stream.

CORBA\_DataOutputStream\_write\_octet
```cmake
void CORBA_DataOutputStream_write_octet (
    CORBA_DataOutputStream os,
    CORBA_octet value,
    CORBA_Environment * ev
)
```

Writes an octet value to a data output stream.

CORBA\_DataOutputStream\_write\_short
```cmake
void CORBA_DataOutputStream_write_short (
    CORBA_DataOutputStream os,
    CORBA_short value,
    CORBA_Environment * ev
)
```

Writes a short value to a data output stream.

CORBA\_DataOutputStream\_write\_ushort

```txt
void CORBA_DataOutputStream_write_ushort (
    CORBA_DataOutputStream os,
    CORBA_unsigned_short value,
    CORBA_Environment * ev
)
```

Writes an unsigned short value to a data output stream.

CORBA\_DataOutputStream\_write\_long
```txt
void CORBA_DataOutputStream_write_long (
    CORBA_DataOutputStream os,
    CORBA_long value,
    CORBA_Environment * ev
)
```

Writes a long value to a data output stream.

CORBA\_DataOutputStream\_write\_ulong
```cmake
void CORBA_DataOutputStream_write_ulong
(
    CORBA_DataOutputStream os,
    CORBA_unsigned_long value,
    CORBA_Environment * ev
)
```

Writes an unsigned long value to a data output stream.

CORBA\_DataOutputStream\_write\_string
```txt
void CORBA_DataOutputStream_write_string(
    CORBA_DataOutputStream os,
    char * value,
    CORBA_Environment * ev
)
```

Writes a string value to a data output stream.

CORBA\_DataOutputStream\_write\_float
```txt
void CORBA_DataOutputStream_write_float(
    CORBA_DataOutputStream os,
    CORBA_float value,
    CORBA_Environment * ev
)
```

Writes a float value to a data output stream.

CORBA\_DataOutputStream\_write\_double
```txt
void CORBA_DataOutputStream_write_double(
    CORBA_DataOutputStream os,
```

```lisp
CORBA_double value,
CORBA_Environment * ev
)
```

Writes a double value to a data output stream.

CORBA\_DataOutputStream\_write\_octet\_array
```txt
void CORBA_DataOutputStream_write_octet_array (
    CORBA_DataOutputStream os,
    CORBA_OctetSeq * seq,
    CORBA_unsigned_long offset,
    CORBA_unsigned_long length,
    CORBA_Environment * ev
)
```

Writes an octet array contained in a sequence to a data output stream. The length argument determines the length of array to be written and the offset argument the array start offset within the sequence.

# 3.1.2 PortableInterceptor Module

Header: PortableInterceptor.h

PortableInterceptor\_register\_orb\_initializer
```txt
PortableInterceptor_register_orb_initializer (
    PortableInterceptor_ORBInitializer * init,
    CORBA_Environment * ev
)
```

This function registers a portable ORB initializer. Initializers should be registered before the ORB is initialized as the ORB initialization calls back on registered initializers.

# 3.1.2.1 ORBInitializer Local Interface

Header: PortableInterceptor/ORBInitializer.h

```c
typedef struct PortableInterceptor_ORBInitializer
{
    void (*pre_init)
    (
    PortableInterceptor_ORBInitInfo info,
    CORBA_Environment * ev
    );

    void (*post_init)
    (
    PortableInterceptor_ORBInitInfo info,
    CORBA_Environment * ev
    );

    void (*fini)
    (
```

```c
PortableInterceptor_ORBInitInfo info,
CORBA_Environment * ev
);
}
PortableInterceptor_ORBInitializer;
```

The ORBInitializer local interface is implemented as a struct containing function pointers to the defined ORB initialization functions (pre\_init and post\_init). An additional Spectra ORB-specific function is also provided (fini) to support initializer clean up on ORB shutdown.

PortableInterceptor\_ORBInitializer\_\_alloc
```txt
PortableInterceptor_ORBInitializer *
PortableInterceptor_ORBInitializer_alloc (void)
```

This function allocates a new instance of an ORBInitializer local interface. This can be registered as an ORB initializer.

3.1.2.2 ORBInitInfo Local Interface

Header: PortableInterceptor/ORBInitInfo.h

```c
typedef CORBA_LocalObject PortableInterceptor_ORBInitInfo;
typedef CORBA_char * PortableInterceptor_ORBInitInfo_ObjectId;
```
PortableInterceptor\_ORBInitInfo\_\_get\_arguments

```cmake
CORBA_sequence_string * PortableInterceptor_ORBInitInfo__get_arguments
(
    PortableInterceptor_ORBInitInfo info,
    CORBA_Environment * ev
)
```

This function returns the list of ORB initialization arguments from an ORBInitInfo local interface.

PortableInterceptor\_ORBInitInfo\_\_get\_orb\_id
```txt
CORBA_char * PortableInterceptor_ORBInitInfo__get_orb_id (
    PortableInterceptor_ORBInitInfo info,
    CORBA_Environment * ev
)
```

This function returns the ORB id of the ORB being initialized.

PortableInterceptor\_ORBInitInfo\_register\_initial\_reference
```cmake
void PortableInterceptor_ORBInitInfo_register_initial_reference (
    PortableInterceptor_ORBInitInfo info,
    PortableInterceptor_ORBInitInfo_ObjectId id.
    CORBA_Object obj,
    CORBA_Environment * ev
)
```

This function registers an initial named (id) reference (obj) with the ORB being initialized.

Throws BAD\_PARAM exception if the obj parameter is NULL or CORBA\_OBJECT\_NIL.

PortableInterceptor\_ORBInitInfo\_resolve\_initial\_references
```txt
CORBA_Object PortableInterceptor_ORBInitInfo_resolve_initial_references (
    PortableInterceptor_ORBInitInfo info,
    PortableInterceptor_ORBInitInfo_ObjectId id.
    CORBA_Environment * ev
)
```

This function resolves an initial named (id) reference with the ORB being initialized. The InvalidName exception is raised if the reference cannot be resolved.

# 3.1.3 EORB Module

EORB\_alloc
```txt
void * EORB_alloc (size_t len)
```

This allocates memory of size len.

EORB\_allocBuffer
```c
void * EORB_allocBuffer (EORB_DtorFN dtor, size_t size, size_t count)
```

This allocates memory for a sequence of count elements of length size with a destructor function, dtor, that is invoked for each element when the memory is released with CORBA\_free.

EORB\_allocVar
```txt
void * EORB_allocVar (EORB_DtorFN dtor, size_t len)
```

This allocates memory with a destructor function, dtor, that is invoked when the memory is released with CORBA\_free.

EORB\_add\_ref
```txt
void EORB_add_ref (void *ptr)
```

Adds a reference to an ORB allocated object.

EORB\_remove\_ref
```txt
void EORB_remove_ref (void *ptr)
```

Removes a reference from an ORB allocated object and frees it if the reference count reaches zero.

EORB\_get\_ref\_count
```cmake
CORBA_unsigned_long EORB_get_ref_count (void *ptr)
```

Returns the reference count of an ORB allocated object.

EORB\_Object\_dump

```cmake
void EORB_Object_dump (CORBA_Object obj)
```

The EORB\_Object\_dump outputs or dumps information about the object passed to the function as obj parameter. This function can be useful for debugging applications.

EORB\_POA\_dump
```txt
void EORB_POA_dump (PortableServer_POA poa)
```

The EORB\_POA\_dump outputs or dumps information about the object in the POA passed to the function as the poa parameter. If a null value is passed, then information about the objects of all of the server’s POAs will be output. This function can be useful for debugging the server component of applications.

EORB\_Any\_extract
```txt
void EORB_Any_extract (
    CORBA_any * src,
    CORBA_any * dst,
    CORBA_Environment * ev
)
```

This operation extracts the value and type from the src any into the dst any. The value must have been heap allocated. The src any has its type set to TC\_null and value set to NULL. The release flag of the src any must also be TRUE. An exception is thrown if the value is not heap allocated.

# 3.1.4 PortableServer Module

Header: PortableServer.h

PortableServer\_ObjectId\_to\_string
```txt
CORBA_char* PortableServer_ObjectId_to_string
(
    PortableServer_ObjectId * oid,
    CORBA_Environment * ev
)
```

Converts and ObjectId to a string. If conversion of the ObjectId to the string produces illegal characters (such as a NULL), then the CORBA\_BAD\_PARAM exception is raised.

PortableServer\_string\_to\_ObjectId
```txt
PortableServer_ObjectId* PortableServer_string_to_ObjectId(
    CORBA_char * str,
    CORBA_Environment * ev
)
```

Converts a string to an ObjectId. This can be used for creating object references before activating them.

# 3.1.4.1 POA Interface

PortableServer\_POA\_activate\_object
```cmake
PortableServer_ObjectId* PortableServer_POA_activate_object(
    PortableServer_POA poa,
    PortableServer_Servant servant,
    CORBA_Environment * ev
)
```

The activate\_object operation activates objects. It generates an ObjectId of type ObjectId, enters the ID and the specified servant in the Active Object Map and returns a pointer to the object’s ObjectId.

# Parameters

servant The servant instance

PortableServer\_POA\_activate\_object\_with\_id
```txt
void PortableServer_POA_activate_object_with_id (
    PortableServer_POA poa,
    const PortableServer_ObjectId * oid,
    PortableServer_Servant servant,
    CORBA_Environment * ev
)
```

Enables a servant to be activated with a user-defined ObjectId, as specified by the oid parameter. The RETAIN policy must be present in order for activate\_object to work: a WrongPolicy exception is thrown if RETAIN is not present. If the POA has another active object which has the same Object ID value, then the ObjectAlreadyActive exception is raised. If the POA has the UNIQUE\_ID policy and the servant is already in the Active Object Map, then the ServantAlreadyActive exception is raised. Otherwise, the activate\_object\_with\_id operation enters an association between the specified Object Id and the specified servant in the Active Object Map.

If the POA has the SYSTEM\_ID policy and it detects that the Object ID value was not generated by the system or for this POA, then the activate\_object\_with\_id operation may raise the BAD\_PARAM system exception. A portable application must not invoke activate\_object\_with\_id on a POA that has the SYSTEM\_ID policy with an Object ID value that was not previously generated by the system for that POA, or, if the POA also has the PERSISTENT policy, for a previous instantiation of the same POA.

PortableServer\_POA\_create\_id\_assignment\_policy
```cmake
PortableServer_IdAssignmentPolicy
    PortableServer_POA_create_id_assignment_policy(
    PortableServer_POA poa,
    PortableServer_IdAssignmentPolicyValue value,
    CORBA_Environment * ev
)
```

Objects with the IdAssignmentPolicy interface are obtained using the create\_id\_assignment\_policy operation and passed to the

PortableServer\_POA\_create\_POA operation to specify whether Object Ids in the created POA are generated by the application or by the ORB. The following values can be supplied:

PortableServer\_USER\_ID - Objects created with that POA are assigned ObjectIds only by the application.
PortableServer\_SYSTEM\_ID - Objects created with that POA are assigned ObjectIds only by the POA. If the POA also has the PERSISTENT policy, assigned ObjectIds must be unique across all instantiations of the same POA.

If this policy is not supplied, it defaults to PortableServer\_SYSTEM\_ID.

PortableServer\_POA\_create\_id\_uniqueness\_policy
```cmake
PortableServer_IdUniquenessPolicy
    PortableServer_POA_create_id_uniqueness_policy(
    PortableServer_POA poa,
    PortableServer_IdUniquenessPolicyValue value,
    CORBA_Environment * ev
)
```

Objects with the PortableServer\_IdUniquenessPolicyValue interface are obtained using the create\_id\_uniqueness\_policy operation and passed to the Portable\_POA\_create\_POA operation to specify whether the servants activated in the created POA must have unique object identities. The following values can be supplied:

PortableServer\_UNIQUE\_ID - servants activated with that POA support exactly one ObjectId.
PortableServer\_MULTIPLE\_ID - a servant activated with that POA may support one or more ObjectIds.

If no PortableServer\_IdUniquenessPolicyValue is specified at POA creation, then the default PortableServer\_UNIQUE\_ID value is used.

PortableServer\_POA\_create\_lifespan\_policy
```txt
PortableServer_LifespanPolicy
    PortableServer_POA_create_lifespan_policy(
    PortableServer_POA poa,
    PortableServer_LifespanPolicyValue value,
    CORBA_Environment * ev
)
```

Objects with the LifespanPolicy interface are obtained using the

PortableServer\_POA\_create\_lifespan\_policy operation and passed to the PortableServer\_POA\_create\_POA operation to specify the lifespan of the objects implemented in the created POA. The following values can be supplied:

PortableServer\_TRANSIENT - The objects implemented in the POA cannot outlive the POA instance in which they are first created. Once the POA enters the deactivated state, any requests received by this POA will cause the POA to raise an OBJECT\_NOT\_EXIST system exception with standard minor code 4.

PortableServer\_PERSISTENT - The objects implemented in the POA can outlive the process in which they are first created.

\- Persistent objects have a POA associated with them (the POA that created them).

When the ORB receives a request on a persistent object, it first searches for the matching POA, based on the names of the POA and all of its ancestors.

- Administrative action beyond the scope of this specification may be necessary to inform the ORB's location service of the creation and eventual termination of existence of this POA, and optionally to arrange for on-demand activation of a process implementing this POA.
- POA names must be unique within their enclosing scope (the parent POA). A portable program can assume that POA names used in other processes will not conflict with its own POA names.

The default policy is PortableServer\_TRANSIENT.

PortableServer\_POA\_create\_POA
```txt
PortableServer_POA PortableServer_POA_create_POA (
    PortableServer_POA poa,
    const char * name,
    PortableServer_POAManager manager,
    CORBA_PolicyList * policies,
    CORBA_Environment * ev
)
```

This operation creates a new POA as a child of the target POA. The specified name identifies the new POA with respect to other POAs with the same parent POA. If the target POA already has a child POA with the specified name, then the AdapterAlreadyExists exception is raised.

If the manager parameter is null, then a new POAManager object is created and associated with the new POA. Otherwise, the specified POAManager object is associated with the new POA. The POAManager object can be obtained using the the\_POAManager attribute name.

The specified policy objects are associated with the POA and used to control its behaviour. The policy objects are effectively copied before this operation returns, so the application is free to destroy them while the POA is in use. Policies are not inherited from the parent POA.

If any of the policy objects specified are not valid for the ORB implementation, if conflicting policy objects are specified, or if any of the specified policy objects require prior administrative action that has not been performed, an InvalidPolicy exception is raised containing the index in the policies parameter value of the first offending policy object.

PortableServer\_POA\_create\_reference
```txt
CORBA_Object PortableServer_POA_create_reference (
    PortableServer_POA poa,
    const CORBA_char * repository_id,
    CORBA_Environment * ev
)
```

This operation creates an object reference that encapsulates a POA-generated Object Id value and the specified interface repository id, repository\_id. The specified repository id, which may be a null string, will become the type\_id of the generated object reference. A repository id that does not identify the most derived interface of the object or one of its base interfaces will result in undefined behaviour.

This operation does not cause an activation to take place. The resulting reference may be passed to clients, so that subsequent requests on those references will cause the appropriate servant manager to be invoked, if one is available. The generated Object Id value may be obtained by invoking POA\_reference\_to\_id with the created reference.

This operation requires the SYSTEM\_ID POA policy; if not set, then the WrongPolicy exception is raised.

PortableServer\_POA\_create\_reference\_with\_id
```txt
CORBA_Object PortableServer_POA_create_reference_with_id (
    PortableServer_POA poa,
    const PortableServer_ObjectId * oid,
    const CORBA_char * repository_id,
    CORBA_Environment * ev
)
```

This operation creates an object reference that encapsulates the specified Object Id and interface repository Id values. The specified repository id, which may be a null string, will become the type\_id of the generated object reference. A repository id that does not identify the most derived interface of the object or one of its base interfaces will result in undefined behaviour.

This operation does not cause an activation to take place. The resulting reference may be passed to clients, so that subsequent requests on those references will cause the object to be activated if necessary, or the default servant used, depending on the applicable policies.

If the POA has the SYSTEM\_ID policy and it detects that the Object Id value was not generated by the system or for this POA, the create\_reference\_with\_id operation may raise the BAD\_PARAM system exception. A portable application must not invoke this operation on a POA that has the SYSTEM\_ID policy with an Object Id value that was not previously generated by the system for that POA, or, if the POA also has the PERSISTENT policy, for a previous instantiation of the same POA.

PortableServer\_POA\_deactivate\_object
```txt
void PortableServer_POA_deactivate_object (
    PortableServer_POA poa,
    const PortableServer_ObjectId * oid,
    CORBA_Environment * ev
)
```

The deactivate\_object operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised.

This operation causes the object with an ObjectId specified by the oid parameter to be deactivated. An object which has been deactivated continues to process requests until there are no active requests for that object. A deactivated object is removed from the Active Object Map after all running requests for that object are completed.

If a servant manager is associated with the POA, ServantActivator\_etherealize is invoked with the oid and the associated servant after the object has been removed from the Active Object Map. Reactivation for the object blocks until etherealization (if necessary) is complete. This includes implicit activation (as described in etherealize) and explicit activation using activate\_object\_with\_id. After an object has been removed from the Active Object Map and etherealized (if necessary), it may then be reactivated through the usual mechanisms. The operation does not wait for requests or etherealization to complete and always returns immediately after deactivating the object.

If the servant associated with the oid is serving multiple Object IDs, the

ServantActivator\_etherealize may be invoked multiple times with the same servant when the other objects are deactivated. It is the responsibility of the object implementation to refrain from destroying the servant while it is active with any ID.

PortableServer\_POA\_destroy
```txt
void PortableServer_POA_destroy
(
    PortableServer_POA self,
    CORBA_boolean etherealize_objects,
    CORBA_boolean wait_for_completion,
    CORBA_Environment * ev
)
```

This function releases all the resources attached to the POA and frees the POA pointer. All of the objects activated on this POA will be deactivated and released. The etherialize\_objects argument is ignored as Minimum CORBA does not support servant managers which implement this functionality. If the wait\_for\_completion argument is TRUE then this operation will block until all requests currently executing on the POAs servants complete.

PortableServer\_POA\_find\_POA
```txt
PortableServer_POA PortableServer_POA_find_POA (
    PortableServer_POA poa,
    const char * name,
    CORBA_boolean activate_it,
    CORBA_Environment * ev
)
```

Returns the POA that matches the given name. The activate\_it parameter is ignored in Minimum CORBA because there are no AdapterActivators in Minimum CORBA. Returns a pointer to the POA. The POA throws the AdapterNonExistent system exception if the specified POA is not found

PortableServer\_POA\_\_get\_the\_name
```python
CORBA_char * PortableServer_POA__get_the_name (
    PortableServer_POA poa,
    CORBA_Environment * ev
)
```

Returns the value of the the\_name attribute. This attribute identifies the POA relative to its parent. This name is assigned when the POA is created. The name of the root POA is defined to be 'RootPOA'.

PortableServer\_POA PortableServer\_POA\_\_get\_the\_parent
```txt
PortableServer_POA PortableServer_POA__get_the_parent (
    PortableServer_POA poa,
    CORBA_Environment * ev
)
```

This operation gets the POA interface’s the\_parent read-only attribute. NULL is returned it this is called on the root POA.

PortableServer\_POA PortableServer\_POA\_\_get\_the\_name
```python
CORBA_char * PortableServer_POA__get_the_name (
    PortableServer_POA poa,
    CORBA_Environment * ev
)
```

This operation gets the POA interface’s the\_name read-only attribute.

PortableServer\_POA PortableServer\_POA\_\_get\_the\_POAManager
```cmake
PortableServer_POAManager PortableServer_POA__get_the_POAManager
(
    PortableServer_POA poa,
    CORBA_Environment * ev
)
```

This operation gets the POA interface’s the\_POAManager read-only attribute.

PortableServer\_POA PortableServer\_POA\_\_get\_the\_children
```txt
PortableServer_POAList * PortableServer_POA__get_the_children
(
    PortableServer_POA poa,
    CORBA_Environment * ev
)
```

This operation gets the POA interface’s the\_children read-only attribute.

PortableServer\_POA\_id\_to\_reference
```txt
CORBA_Object PortableServer_POA_id_to_reference (
    PortableServer_POA self,
    const PortableServer_ObjectId * oid,
    CORBA_Environment * ev
)
```

This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised. If an object with the specified Object ID value is currently active, a reference encapsulating the information used to activate the object is returned. If the Object ID value is not active in the POA, the an ObjectNotActive exception is raised.

PortableServer\_POA\_id\_to\_servant
```txt
PortableServer_Servant PortableServer_POA_id_to_servant (
```

```txt
PortableServer_POA self,
const PortableServer_ObjectId * oid,
CORBA_Environment * ev
)
```

This operation requires the RETAIN policy or the USE\_DEFAULT\_SERVANT policy. If neither policy is present, the WrongPolicy exception is raised. If the POA has the RETAIN policy and the specified ObjectId is in the Active Object Map, then this operation returns the servant associated with that object in the Active Object Map. Otherwise, if the POA has the USE\_DEFAULT\_SERVANT policy and a default servant has been registered with the POA, this operation returns the default servant. Otherwise the ObjectNotActive exception is raised.

PortableServer\_POA\_reference\_to\_id
```cmake
PortableServer_ObjectId * PortableServer_POA_reference_to_id (
    PortableServer_POA self,
    CORBA_Object ref,
    CORBA_Environment * ev
)
```

Returns a pointer to the object ID for the specified object reference. This operation is valid only if the reference was created by the POA on which the operation is being performed. The object denoted by the reference does not have to be active for this operation to succeed. Throws the WrongAdapter exception if the specified object reference was not created by this POA.

PortableServer\_POA\_reference\_to\_servant
```txt
PortableServer_Servant PortableServer_POA_reference_to_servant (
    PortableServer_POA self,
    CORBA_Object ref,
    CORBA_Environment * ev
)
```

This operation requires the RETAIN policy or the USE\_DEFAULT\_SERVANT policy. If neither policy is present, the WrongPolicy exception is raised. If the POA has the RETAIN policy and the specified object is present in the Active Object Map, then this operation returns the servant associated with that object in the Active Object Map. Otherwise, if the POA has the USE\_DEFAULT\_SERVANT policy and a default servant has been registered with the POA, then this operation returns the default servant. Otherwise, the ObjectNotActive exception is raised. If the object reference was not created by this POA, then the WrongAdapter exception is raised.

PortableServer\_POA\_servant\_to\_id
```txt
PortableServer_ObjectId* PortableServer_POA_servant_to_id (
    PortableServer_POA self,
    PortableServer_Servant servant,
    CORBA_Environment * ev
)
```

This operation requires the USE\_DEFAULT\_SERVANT policy or a combination of the RETAIN policy and either the UNIQUE\_ID or IMPLICIT\_ACTIVATION policies; if not present, the WrongPolicy exception is raised.

This operation has four possible behaviours:

1. If the POA has the UNIQUE\_ID policy and the specified servant is active, then the Object Id associated with that servant is returned.
2. If the POA has the IMPLICIT\_ACTIVATION policy and either the POA has the MULTIPLE\_ID policy or the specified servant is not active, the servant is activated using a POA-generated Object Id and the Interface Id associated with the servant, and that Object Id is returned.
3. If the POA has the USE\_DEFAULT\_SERVANT policy, the servant default servant, and the operation is being invoked in the request on the default servant, then the ObjectId associated invocation is returned.
4. Otherwise, the ServantNotActive exception is raised

PortableServer\_POA\_servant\_to\_reference
```txt
CORBA_Object PortableServer_POA_servant_to_reference (
    PortableServer_POA self,
    PortableServer_Servant servant,
    CORBA_Environment * ev
)
```

This operation requires the RETAIN policy and either the UNIQUE\_ID or IMPLICIT\_ACTIVATION policies if invoked outside the context of an operation dispatched by this POA. If this operation is not invoked in the context of executing a request on the specified servant and the policies specified previously are not present the WrongPolicy exception is raised.

This operation has four possible behaviours:

1. If the POA has both the RETAIN and the UNIQUE\_ID policy and the specified servant is active, an object reference encapsulating the information used to activate the servant is returned.
2. If the POA has both the RETAIN and the IMPLICIT\_ACTIVATION policy and either the POA has the MULTIPLE\_ID policy or the specified servant is not active, the servant is activated using a POA-generated Object Id and the Interface Id associated with the servant, and a corresponding object reference is returned.
3. If the operation was invoked in the context of executing a request on the specified servant, the reference associated with the current invocation is returned.
4. Otherwise, the ServantNotActive exception is raised.

# 3.1.4.2 Current Interface

PortableServer\_Current\_get\_object\_id
```txt
PortableServer_ObjectId * PortableServer_Current_get_object_id (
    PortableServer_Current current,
    CORBA_Environment * ev
)
```

This operation returns the ObjectId identifying the object in whose context it is called. If called outside the context of a POA-dispatched operation, a NoContext exception is raised.

PortableServer\_Current\_get\_POA
```cmake
PortableServer_POA PortableServer_Current_get_POA (
    PortableServer_Current current,
    CORBA_Environment * ev
)
```

This operation returns a reference to the POA implementing the object in whose context it is called. If called outside the context of a POA-dispatched operation, then a NoContext exception is raised.

PortableServer\_Current\_get\_reference
```txt
CORBA_Object PortableServer_Current_get_reference (
    PortableServer_Current current,
    CORBA_Environment * ev
)
```

This operation returns an object reference to the servant in whose context it is called. If called outside the context of a POA-dispatched operation, then a NoContext exception is raised.

PortableServer\_Current\_get\_servant
```txt
PortableServer_servant PortableServer_Current_get_servant (
    PortableServer_Current current,
    CORBA_Environment * ev
)
```

This operation returns a reference to the servant in whose context it is called. If called outside the context of a POA-dispatched operation, then a NoContext exception is raised.

# 3.1.4.3 POAManager Interface

PortableServer\_POAManager\_activate
```txt
void PortableServer_POAManager_activate(
    PortableServer_POAManager manager,
    CORBA_Environment * ev
)
```

This function activates all transport listeners so POAs can start handling incoming requests. The ORB run function has the same effect.

PortableServer\_POAManager\_get\_id
```txt
CORBA_char * PortableServer_POAManager_get_id (
    PortableServer_POAManager manager,
    CORBA_Environment * ev
)
```

This function returns the identity of a POAManager.

# 3.1.5 Messaging Module

Header: Messaging.h

Types
```c
/* Messaging::RelativeRoundtripTimeoutPolicy */

typedef CORBA_Policy Messaging_RelativeRoundtripTimeoutPolicy;
#define Messaging_RELATIVE_RT_TIMEOUT_POLICY_TYPE 32

/* Messaging::SyncScopePolicy */

typedef CORBA_short Messaging_SyncScope;
typedef CORBA_Policy Messaging_SyncScopePolicy;
#define Messaging_SYNC_SCOPE_POLICY_TYPE 24
#define TC_Messaging_SyncScope_TC_short

#define Messaging_SYNC_NONE 0
#define Messaging_SYNC_WITH_TRANSPORT 1
#define Messaging_SYNC_WITH_SERVER 2
#define Messaging_SYNC_WITH_TARGET 3
```

# 3.1.5.1 SyncScopePolicy Interface

Messaging\_SyncScopePolicy\_\_get\_synchronization
```txt
Messaging_SyncScope Messaging_SyncScopePolicy__get_synchronization(
    Messaging_SyncScopePolicy policy,
    CORBA_Environment * _ev
);
```

This returns the sync scope from a sync scope policy.

# 3.1.6 IOP::Codec Module

Header: IOP.h

Types
```c
#define IOP_ENCODING_CDR_ENCAPS 0
typedef CORBA_short IOP_EncodingFormat;
typedef CORBA_LocalObject IOP_CodeFactory;

typedef struct IOP_Encoding
{
    IOP_EncodingFormat format;
    CORBA_octet major_version;
    CORBA_octet minor_version;
}
IOP_Encoding;

const char * ex_IOP_Codevars_InvalidTypeForEncoding;
const char * ex_IOP_Codevars_FormatMismatch;
const char * ex_IOP_Codevars_TypeMismatch;
const char * ex_IOP_CodevarsFactory_UnknownEncoding;
```

# 3.1.6.1 CodecFactory Interface

IOP\_CodecFactory\_create\_codec
```txt
IOP_Codec IOP_CodecFactory_create_codec (
    IOP_CodecFactory factory,
    IOP_Encoding * enc,
    CORBA_Environment * _ev
);
```

The CodecFactory object can be resolved as a named initial reference “CodecFactory”. The create\_codec function can then be used to create a Codec supporting a given encoding as defined in the enc argument. The only supported type of encoding is IOP\_ENCODING\_CDR\_ENCAPS and the major version must be 1 or the function will throw an UnknownEncoding exception.

# 3.1.6.2 Codec Interface

IOP\_Codec\_encode
```txt
CORBA_OctetSeq * IOP_Codec_encode (
    IOP_Codec codec,
    CORBA_any * data,
    CORBA_Environment * _ev
);
```

This operation encodes the type and content of the any argument as a CDR encapsulation which is returned as a sequence of octets. If the type in the any cannot be encoded then the InvalidTypeForEncoding exception will be raised.

IOP\_Codec\_encode\_value
```txt
CORBA_OctetSeq * IOP_Codec_encode_value (
    IOP_Codec codec,
    CORBA_any * data,
    CORBA_Environment * _ev
);
```

This operation encodes the content of the any argument as a CDR encapsulation which is returned as a sequence of octets. If the type in the any cannot be encoded then the InvalidTypeForEncoding exception will be raised. Note that unlike the encode operation the type of the any is not encoded.

IOP\_Codec\_decode
```sql
CORBA_any * IOP_Codec_decode
(
    IOP_Codec codec,
    CORBA_OctetSeq * data,
    CORBA_Environment * _ev
);
```

This operation decodes the type and content of an any from a CDR encapsulation which is provided as a sequence of octets in the data argument. A new any containing the type and content of the CDR is returned from the operation. If the type in the CDR cannot be decoded then the FormatMismatch exception will be raised.

IOP\_Codec\_decode\_value
```txt
CORBA_any * IOP_Codeec_decode (
    IOP_Codeec codec,
    CORBA_OctetSeq * data,
    CORBA_TypeCode tc,
    CORBA_Environment * _ev
);
```

This operation decodes the content of an any from a CDR encapsulation which is provided as a sequence of octets in the data argument. The type of the data in the CDR must be provided as the tc argument A new any containing the type and content of the CDR is returned from the operation. If the content in the CDR cannot be decoded then the FormatMismatch exception will be raised.

# 3.2 CORBA Exceptions

Table 3 lists the standard CORBA system exceptions supported by the ORB. Table 4 lists proprietary ORBspecific exceptions.

i The standard minor codes for the standard system exceptions are prefaced by the VMCID assigned to OMG, namely:

#define CORBA\_OMGVMCID 0x4f4d0000

The minor codes for ORB-specific exceptions are prefaced by the VMCID assigned by the OMG to Spectra ORB:

#define EORB\_VMCID 0x58500000

Table 3 Standard System Exceptions (OMGVMCID)

<table><tr><td>CORBA Exception</td><td>Minor Code</td><td>Value</td><td>Description</td></tr><tr><td>UNKNOWN</td><td>EORB_OMG_UNKNOWN_M1</td><td>1</td><td>Unlisted user exception received by client.</td></tr><tr><td>UNKNOWN</td><td>EORB_OMG_UNKNOWN_M2</td><td>2</td><td>Non-standard System Exception not supported.</td></tr><tr><td>TRANSIENT</td><td>EORB_OMG_TRANSIENT_M1</td><td>1</td><td>Request discarded by POA.</td></tr><tr><td>BAD_PARAM</td><td>EORB_OMG_BAD_PARAM_M7</td><td>7</td><td>String to object conversion failed due to bad scheme name.</td></tr><tr><td>BAD_PARAM</td><td>EORB_OMG_BAD_PARAM_M8</td><td>8</td><td>String to object conversion failed due to bad address.</td></tr><tr><td>BAD_PARAM</td><td>EORB_OMG_BAD_PARAM_M9</td><td>9</td><td>String to object conversion failed due to bad schema specific part.</td></tr><tr><td>BAD_PARAM</td><td>EORB_OMG_BAD_PARAM_M10</td><td>10</td><td>String to object conversion failed due to non specific reason.</td></tr><tr><td>BAD_PARAM</td><td>EORB_OMG_BAD_PARAM_M27</td><td>27</td><td>Attempt to call register an initial reference with a null Object.</td></tr><tr><td>DATA_CONVERSION</td><td>EORB_OMG_DATA_CONVERSION_M2</td><td>2</td><td>Failure of priority mapping object.</td></tr><tr><td>BAD_OPERATION</td><td>EORB_OMG_BAD_OPERATION_M2</td><td>2</td><td>Operation or attribute not known to target object.</td></tr><tr><td>BAD_INV_ORDER</td><td>EORB_OMG_BAD_INV_ORDER_M3</td><td>3</td><td>Operation would deadlock.</td></tr><tr><td>INV_POLICY</td><td>EORB_OMG_INV_POLICY_M2</td><td>2</td><td>Invalid policy identifier.</td></tr><tr><td>MARSHAL</td><td>EORB_OMG_MARSHAL_M4</td><td>4</td><td>Attempt to marshal local object.</td></tr><tr><td>NO_IMPLEMENTment</td><td>EORB_OMG_NO_IMPLEMENTMENT_M3</td><td>3</td><td>Unable to use any profile in IOR</td></tr><tr><td>NO_IMPLEMENTment</td><td>EORB_OMG_NO_IMPLEMENTMENT_M8</td><td>8</td><td>Operation not implemented in local object.</td></tr><tr><td>NO_RESOURCES</td><td>EORB_OMG_NO_RESOURCES_M2</td><td>2</td><td>No connections for request&#x27;s priority.</td></tr></table>

Table 4 ORB-Specific Exceptions (EORB\_VMCID)

<table><tr><td>Exception</td><td>Minor Code</td><td>Value</td><td>Description</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M1</td><td>1</td><td>Invalid NULL argument to operation.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M2</td><td>2</td><td>Invalid nil object reference.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M3</td><td>3</td><td>Bad TypeCode type.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M4</td><td>4</td><td>Invalid object id.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M5</td><td>5</td><td>Invalid sequence length.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M6</td><td>6</td><td>Invalid policy.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M7</td><td>7</td><td>Invalid environment.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M8</td><td>8</td><td>Already Active.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M9</td><td>9</td><td>Invalid ID.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M10</td><td>10</td><td>Invalid Priority.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M11</td><td>11</td><td>Local call on non local on non initialized local object.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M12</td><td>12</td><td>Call on local object.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M13</td><td>13</td><td>Servant finalizer called with NULL vepv.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M14</td><td>14</td><td>Servant initializer called with NULL vepv.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M15</td><td>15</td><td>Invalid operation on POA with SYSTEM_ID policy.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M16</td><td>16</td><td>Attempt to extract non heap allocated value from any.</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M17</td><td>17</td><td>Attempt to activate servant on POA with no transport</td></tr><tr><td>BAD_PARAM</td><td>EORB OMG_BAD_PARAM_M18</td><td>18</td><td>Attempt to marshal uninitialized union</td></tr><tr><td>IMPL_LIMIT</td><td>EORB OMG_IMPL_LIMIT_M2</td><td>2</td><td>POA Table Full.</td></tr><tr><td>IMPL_LIMIT</td><td>EORB OMG_IMPL_LIMIT_M3</td><td>3</td><td>Servant Table Full.</td></tr><tr><td>IMPL_LIMIT</td><td>EORB OMG_IMPL_LIMIT_M4</td><td>4</td><td>Unable to allocate memory.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M1</td><td>1</td><td>Failed to open file.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M2</td><td>2</td><td>Failed to read IOR.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M3</td><td>3</td><td>Bad Servant Table.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M4</td><td>4</td><td>Bad Reply Type.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M6</td><td>6</td><td>SCA Port not connected.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M7</td><td>7</td><td>SCA Component destroyed.</td></tr><tr><td>INTERNAL</td><td>EORB_INTERNAL_M8</td><td>8</td><td>SCA Component uninitialized.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M1</td><td>1</td><td>Attempt to reinitialise singleton ORB after it has been destroyed.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M2</td><td>2</td><td>Attempt to destroy singleton ORB with active references.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M3</td><td>3</td><td>Failed to obtain license.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M4</td><td>4</td><td>Bad Component Declaration.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M5</td><td>5</td><td>Bad Object Declaration.</td></tr><tr><td>INITIALIZE</td><td>EORB INITIALIZE_M6</td><td>6</td><td>Bad declaration.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M7</td><td>7</td><td>No environment.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M8</td><td>8</td><td>Bad configuration.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M9</td><td>9</td><td>Bad URL Syntax.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M10</td><td>10</td><td>Name Not Found.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M11</td><td>11</td><td>ORB Not Initialized.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M12</td><td>12</td><td>Component initialization failure.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M13</td><td>13</td><td>Bad Component.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M14</td><td>14</td><td>Transport for profile not found.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M15</td><td>15</td><td>Priority not set.</td></tr><tr><td>INITIALIZE</td><td>EORB_INITIALIZE_M16</td><td>16</td><td>Transport connection error.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M1</td><td>1</td><td>Transport failed to receive data.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M2</td><td>2</td><td>Transport failed to connect.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M3</td><td>3</td><td>Transport failed to send.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M4</td><td>4</td><td>Received GIOP message error.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M5</td><td>5</td><td>Received unknown GIOP message type.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M9</td><td>9</td><td>Received unexpected GIOP LocateReply message.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M10</td><td>10</td><td>Attempted 2-Way call on 1-Way transport.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M11</td><td>11</td><td>Failed to establish transport listener.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M12</td><td>12</td><td>Unsupported GIOP addressing disposition.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M13</td><td>13</td><td>Transport failed to send data - connection closed by peer.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M14</td><td>14</td><td>Transport failed to receive data - connection closed by peer.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M15</td><td>15</td><td>Transport failed to receive data.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M16</td><td>16</td><td>Transport failed to open connection socket.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M17</td><td>17</td><td>Transport non-blocking connection attempt has not succeeded.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M18</td><td>18</td><td>Transport failed to connect.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M20</td><td>20</td><td>Transport failed to accept connection.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M21</td><td>21</td><td>Transport failed to open socket in connection initialisation.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M22</td><td>22</td><td>Transport failed to bind socket in connection initialisation.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M23</td><td>23</td><td>Transport failed to write datagram data - connection closed.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M24</td><td>24</td><td>Transport failed to write datagram data.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M25</td><td>25</td><td>Transport failed to receive enough datagram data.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M26</td><td>26</td><td>Transport failed to open datagram connection socket.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M28</td><td>28</td><td>Transport failed to receive datagram - connection closed.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M29</td><td>29</td><td>Transport non-blocking datagram read failedduring wait for accept request.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M30</td><td>30</td><td>Transport datagram read failed.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M32</td><td>32</td><td>Transport failed - socket already in shutdown in datagram listen.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M33</td><td>33</td><td>Transport failed to open socket in datagram connection initialisation.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M34</td><td>34</td><td>Transport failed to bind socket in datagram connection initialisation.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M36</td><td>36</td><td>Unrecoverable data loss (not reliable) in message receive pgm.</td></tr><tr><td>COMM_FAILURE</td><td>EORB_COMM_FAILURE_M37</td><td>37</td><td>Provided buffer was too small to receive entire APDU.</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M1</td><td>1</td><td>Transport receive timeout.</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M2</td><td>2</td><td>Transport connect timeout.</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M3</td><td>3</td><td>Transport send timeout.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M1</td><td>1</td><td>Feature not supported by operating system.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M2</td><td>2</td><td>Feature not yet implemented in ORB.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M3</td><td>3</td><td>Operation Not Found.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M4</td><td>4</td><td>Protocol Not Loaded.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M6</td><td>6</td><td>No TypeCode Support.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M8</td><td>8</td><td>No asynchronous support.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M11</td><td>11</td><td>No TCP support.</td></tr><tr><td>NO_IMPLEMENT</td><td>EORB_NO_IMPLEMENT_M12</td><td>12</td><td>Realtime operation called without RTORB plugin.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M1</td><td>1</td><td>TypeCode for any marshal not found.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M3</td><td>3</td><td>Buffer underflow.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M4</td><td>4</td><td>Invalid GIOP Header.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M5</td><td>5</td><td>Invalid GIOP Reply Status.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M6</td><td>6</td><td>Invalid GIOP Message Type.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M9</td><td>9</td><td>Unsupported type.</td></tr><tr><td>MARSHAL</td><td>EORB_MARSHAL_M10</td><td>10</td><td>Any or fixed type support not configured .</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M1</td><td>1</td><td>Transport receive timeout.</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M2</td><td>2</td><td>Transport connect timeout.</td></tr><tr><td>TIMEOUT</td><td>EORB_TIMEOUT_M3</td><td>3</td><td>Transport send timeout.</td></tr><tr><td>INV_OBJREF</td><td>ORB_INV_OBJREF_M1</td><td>1</td><td>Can't Bind.</td></tr><tr><td>OBJECT_NOT_EXIST</td><td>EORB_OBJECT_NOT_EXIST_M1</td><td>1</td><td>Object Not Found.</td></tr><tr><td>INV_POLICY</td><td>EORB_INV_POLICY_M1</td><td>1</td><td>No thread pool found.</td></tr><tr><td>INV_POLICY</td><td>EORB_INV_POLICY_M2</td><td>2</td><td>Failed to listen on policy specified transport.</td></tr><tr><td>INV_POLICY</td><td>EORB_INV_POLICY_M3</td><td>3</td><td>Failed to bind to policy specified transport.</td></tr><tr><td>UNKNOWN</td><td>EORB_UNKNOWN_M1</td><td>1</td><td>Inbound priority transform returned false.</td></tr><tr><td>UNKNOWN</td><td>EORB_UNKNOWN_M2</td><td>1</td><td>Outbound priority transform returned false.</td></tr></table>

# 3.3 Standard User Exceptions

The ORB’s standard User Exceptions are described below. These exceptions may be returned as a result of any operation invocation, regardless of the interface specification. Standard user exceptions may not be listed in raises expressions. The ORB’s System Exceptions are described under Standard System Exceptions.

# PortableServer\_POA\_AdapterAlreadyExists

The AdapterAlreadyExists exception is thrown when trying to create a new, child POA on a target POA (using POA\_create\_POA) and the target POA already has a child POA with the same name.

# PortableServer\_POA\_AdapterNonExistent

The AdapterNonExistent is thrown when trying to find a target POA’s named child POA (using POA\_find\_POA) and the child POA’s name is not found (i.e., the child POA does not exist).

# PortableServer\_POA\_InvalidPolicy

The InvalidPolicy exception is thrown when creating a POA (using POA\_create\_POA) and if any of the following conditions occur:

● the policy objects specified are not valid for the ORB
● conflicting policy objects are specified
the specified policy objects require prior administrative action that has not been performed

# PortableServer\_POA\_ObjectAlreadyActive

The ObjectAlreadyActive exception is thrown when creating a CORBA object with a user ID (using POA\_activate\_object\_with\_id) and an existing object with the same ID value is already active in the POA.

# PortableServer\_POA\_ObjectNotActive

The ObjectNotActive exception is thrown when trying to access or perform an operation on an object that has not been activated.

# PortableServer\_POA\_ServantAlreadyActive

The ServantAlreadyActive is thrown when attempting to activate an object that has already been activated (e.g. when using POA\_activate or POA\_activate\_with\_id).

# PortableServer\_POA\_ServantNotActive

The ServantNotActive exception is thrown when performing an operation which requires or expects an activated servant, but the servant is not activated.

# PortableServer\_POA\_WrongAdapter

The WrongAdapter exception is thrown when performing an operation from a POA (e.g. POA\_reference\_to\_servant) on an object and the object was created by another POA.

# PortableServer\_POA\_WrongPolicy

The WrongPolicy exception is thrown when one or more policies, that an operation expects or depends on, has not been set or is not present.

# CORBA\_ORB\_InvalidName

This exception is raised when an operation is passed a name, such as the string value of an ObjectId, which is invalid. The name could be invalid because:

● the name value passed to the operation is an empty string
● the name being passed to the operation does not exist (e.g. when using resolve\_intial\_references to identify an object)
● the name being used for an object.

# 3.4 Standard System Exceptions

The ORB’s standard System Exceptions are described below. These exceptions may be returned as a result of any operation invocation, regardless of the interface specification.

# CORBA\_UNKNOWN

This exception is raised if an operation implementation throws a non-CORBA exception (such as an exception specific to the implementation's programming language), or if an operation raises a user exception that does not appear in the operation's raises expression. UNKNOWN is also raised if the server returns a system exception that is unknown to the client. (This can happen if the server uses a later version of CORBA than the client and new system exceptions have been added to the later version.)

# CORBA\_BAD\_PARAM

A parameter passed to a call is out of range or otherwise considered illegal. An ORB may raise this exception if null values or null pointers are passed to an operation (for language mappings where the concept of a null pointers or null values applies). BAD\_PARAM can also be raised as a result of client generating requests with incorrect parameters using the DII.

# CORBA\_NO\_MEMORY

The ORB cannot allocate new memory..

# CORBA\_IMP\_LIMIT

This exception indicates that an implementation limit was exceeded in the ORB run time. For example, an ORB may reach the maximum number of references it can hold simultaneously in an address space, the size of a parameter may have exceeded the allowed maximum, or an ORB may impose a maximum on the number of clients or servers that can run simultaneously.

# CORBA\_COMM\_FAILURE

This exception is raised if communication is lost while an operation is in progress, after the request was sent by the client, but before the reply from the server has been returned to the client.

# CORBA\_INV\_OBJREF

This exception indicates that an object reference is internally malformed. For example, the repository ID may have incorrect syntax or the addressing information may be invalid. This exception is raised by ORB\_string\_to\_object if the passed string does not decode correctly. An ORB may choose to detect calls via nil references (but is not obliged to do detect them). INV\_OBJREF is used to indicate this.

# CORBA\_NO\_PERMISSION

An invocation failed because the caller has insufficient privileges.

# CORBA\_INTERNAL

This exception indicates an internal failure in an ORB, for example, if an ORB has detected corruption of its internal data structures.

# CORBA\_NO\_IMPLEMENT

This exception indicates that even though the operation that was invoked exists (it has an IDL definition), no implementation for that operation exists. NO\_IMPLEMENT can, for example, be raised by an ORB if a client asks for an object's type definition from the interface repository, but no interface repository is provided by the ORB.

# CORBA\_BAD\_TYPECODE

The ORB has encountered a malformed type code (for example, a type code with an invalid TCKind value).

# CORBA\_BAD\_OPERATION

This indicates that an object reference denotes an existing object, but that the object does not support the operation that was invoked.

# CORBA\_NO\_RESOURCES

The ORB has encountered some general resource limitation. For example, the run time may have reached the maximum permissible number of open connections.

# CORBA\_NO\_RESPONSE

This exception is raised if a client attempts to retrieve the result of a deferred synchronous call, but the response for the request is not yet available.

# CORBA\_PERSIST\_STORE

This exception indicates a persistent storage failure, for example, failure to establish a database connection or corruption of a database.

# CORBA\_BAD\_INV\_ORDER

This exception indicates that the caller has invoked operations in the wrong order. For example, it can be raised by an ORB if an application makes an ORB-related call without having correctly initialized the ORB first.

# CORBA\_TRANSIENT

TRANSIENT indicates that the ORB attempted to reach an object and failed. It is not an indication that an object does not exist. Instead, it simply means that no further determination of an object's status was possible because it could not be reached. This exception is raised if an attempt to establish a connection fails, for example, because the server or the implementation repository is down.

# CORBA\_FREE\_MEM

The ORB failed in an attempt to free dynamic memory, for example because of heap corruption or memory segments being locked.

# CORBA\_INV\_IDENT

This exception indicates that an IDL identifier is syntactically invalid. It may be raised if, for example, an identifier passed to the interface repository does not conform to IDL identifier syntax, or if an illegal operation name is used with the DII.

# CORBA\_INV\_FLAG

An invalid flag was passed to an operation (for example, when creating a DII request).

# CORBA\_OBJ\_ADAPTER

This exception typically indicates an administrative mismatch. For example, a server may have made an attempt to register itself with an implementation repository under a name that is already in use, or is unknown to the repository. OBJ\_ADAPTER is also raised by the POA to indicate problems with application-supplied servant managers.

# CORBA\_DATA\_CONVERSION

This exception is raised if an ORB cannot convert the representation of data as marshalled into its native representation or vice-versa. For example, DATA\_CONVERSION can be raised if wide character code set conversion fails, or if an ORB cannot convert floating point values between different representations.

# CORBA\_OBJECT\_NOT\_EXIST

The OBJECT\_NOT\_EXIST exception is raised whenever an invocation on a deleted object was performed. It is an authoritative hard fault report. Anyone receiving it is allowed (even expected) to delete all copies of this object reference and to perform other appropriate “final recovery” style procedures. Bridges forward this exception to clients, also destroying any records they may hold (for example, proxy objects used in reference translation). The clients could in turn purge any of their own data structures.

# CORBA\_MARSHAL

A request or reply from the network is structurally invalid. This error typically indicates a bug in either the client-side or server-side run time. For example, if a reply from the server indicates that the message contains 1000 bytes, but the actual message is shorter or longer than 1000 bytes, the ORB raises this exception. MARSHAL can also be caused by using the DII or DSI incorrectly, for example, if the type of the actual parameters sent does not agree with IDL signature of an operation.

# CORBA\_INITIALIZE

An ORB has encountered a failure during its initialization, such as failure to acquire networking resources or detecting a configuration error.

# 3.5 Policies

The ORB allows access to certain choices that affect its operation. This information is accessed in a structured manner using interfaces derived from the Policy interface defined in the CORBA module.

```txt
//IDL Policy interface specification
module CORBA
{
    typedef unsigned long PolicyType;

    interface Policy
    {
    readonly attribute PolicyType policy_type;
    Policy copy ();
    void destroy ();
    };
    typedef sequence &lt;Policy&gt; PolicyList;
};
```

PolicyType defines the type of Policy object. In general, the constant values that are allocated are defined in conjunction with the definition of the corresponding Policy object. The values of PolicyTypes for policies that are standardized by OMG are allocated by OMG. PolicyType, of type unsigned long, consists of a 20-bit Vendor PolicyType Valueset ID (VPVID) in the high order 20 bits, and a vendor assigned policy value in the low order 12 bits. The VPVIDs 0 through \xf are reserved for the OMG. All values for the standard PolicyTypes are allocated within this range by the OMG. For Spectra ORB-specific policies, the VPVID is set to EORB\_VPVID.

# 3.5.1 Policy Values

Supported CORBA standard policy APIs plus the ORB’s specific policy extensions are described below. Policies can be set at ORB, POA, Thread or Object scope. The policy for an Object is determined by checking for a Policy override at the Object, POA, Thread and then finally ORB scope. If no override is found, then the default Policy value is used. Table 5 gives the scope of each policy. The following policies are supported by the ORB:

RELATIVE\_RT\_TIMEOUT\_POLICY\_TYPE - The duration allowed for a request or its reply to be delivered. When the duration is exceeded, then the request if cancelled (if a reply has not yet been received) or the reply is discarded (if one has been received).
EORB\_POLICY\_CONNECT\_TIMEOUT - The time out for when a client initially connects (binds) to a server.
EORB\_POLICY\_IMPL\_NAME - Used to set the server name for a process. This is encoded within a persistent IOR and is used to disambiguate objects created with the same id and POA name but within different server processes.

● RTCORBA\_SERVER\_PROTOCOL\_POLICY\_TYPE - Used to configure a POA with a specific set of profiles, for example IIOP/DIOP. A protocol object in the list contained by the ServerProtocolPolicy will be used for the selection of transports that the POA should use. It may have its transport\_protocol\_properties set to Null (if additional configuration of the transport is not required), otherwise transport\_protocol\_properties points at an instance of a subtype of ProtocolProperties, in which case this will be used for the transport configuration. For example, it could be an instance of RTCORBA TCPProtocolProperties. Refer to the ServerProtocolPolicy section of the Real-time CORBA Specification for additional information. Functions, in addition to those in the standard TCPProtocolProperties interface, are provided in Spectra ORB which enable additional transport values to be set. These additional functions are listed under Additional Transport Value Setting Functions . The persistent example in the product distribution demonstrates how to set RTCORBA policies.

● EORB\_POLICY\_CONNECT\_TIMEOUT Sets the ORB transport connection time-out.
RELATIVE\_RT\_TIMEOUT\_POLICY\_TYPE and RTCORBA\_SERVER\_PROTOCOL\_POLICY\_TYPE are standard CORBA policies.

All other policies are proprietary Spectra ORB policies.

Table 5 Policies

<table><tr><td>Policy</td><td>Scope</td><td>Type</td></tr><tr><td>EORB_POLICY_CONNECT_TIMEOUT</td><td>Object</td><td>TC_TimeBase_TimeT</td></tr><tr><td>RELATIVE_RT_TIMEOUT_POLICY_TYPE</td><td>Object</td><td>TC_TimeBase_TimeT</td></tr></table>

# 3.5.1.1 Additional Transport Value Setting Functions

```c
void EORB_TCP (void)
CORBA_boolean EORB_TCP_ProtocolProperties__get_cloexec
(
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_cloexec
(
    EORB_TCP_ProtocolProperties props,
    CORBA_boolean cloexec,
    CORBA_Environment * ev
)

char * EORB_TCP_ProtocolProperties__get_host
(
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_host
(
    EORB_TCP_ProtocolProperties props,
    char * host,
```

```cmake
CORBA_Environment * ev
)

CORBA_unsigned_short EORB_TCP_ProtocolProperties__get_port (
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_port (
    EORB_TCP_ProtocolProperties props,
    CORBA_unsigned_short port,
    CORBA_Environment * ev
)

CORBA_boolean EORB_TCP_ProtocolProperties__get_reuse (
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_reuse (
    EORB_TCP_ProtocolProperties props,
    CORBA_boolean reuse,
    CORBA_Environment * ev
)

CORBA_boolean EORB_TCP_ProtocolProperties__get_linger (
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_linger (
    EORB_TCP_ProtocolProperties props,
    CORBA_boolean linger,
    CORBA_Environment * ev
)

CORBA_long EORB_TCP_ProtocolProperties__get_lingertime (
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)

void EORB_TCP_ProtocolProperties__set_lingertime (
    EORB_TCP_ProtocolProperties props,
    CORBA_long ltime,
    CORBA_Environment * ev
)

CORBA_boolean EORB_TCP_ProtocolProperties__get_debug (
    EORB_TCP_ProtocolProperties props,
    CORBA_Environment * ev
)
```

```cmake
void EORB_TCP_ProtocolProperties__set_debug (
    EORB_TCP_ProtocolProperties props,
    CORBA_boolean debug,
    CORBA_Environment * ev
)
```

# 3.5.2 Policy Errors

# 3.5.2.1 Policy Error Exception

The PolicyError exception is raised to indicate problems with parameter values passed to the CORBA\_ORB\_create\_policy operation.

# 3.5.2.2 Policy Error Codes

A request to create a Policy may be invalid. The reasons, PolicyErrorCodes, are listed below:

● CORBA\_BAD\_POLICY - the requested Policy is not understood by the ORB.
CORBA\_UNSUPPORTED\_POLICY - the requested Policy is understood to be valid by the ORB, but is not currently supported.
CORBA\_BAD\_POLICY\_TYPE - The type of the value requested for the Policy is not valid for that PolicyType.
CORBA\_BAD\_POLICY\_VALUE - The value requested for the Policy is of a valid type but is not within the valid range for that type.
● CORBA\_UNSUPPORTED\_POLICY\_VALUE - The value requested for the Policy is of a valid type and within the valid range for that type, but this valid value is not currently supported.
[🔗 Link to the original document](.spectra-orb-c-edition-reference-guide/spectra-orb-c-edition-reference-guide.pdf)
