C++ Memory Management

Object references in C++ are dynamically allocated and, consequently, care has to be taken to avoid leaking the associated memory. As with other heap-allocated CORBA data (see Chapter 4, “Memory Management”), object references can be by either dumb or smart pointers. The C++ language mapping specifies that two C++ classes are generated for each IDL interface, as given in Table 5.1:

Table 5.1. C++ Mapping of Interfaces
C++ Mapped TypeDescription
IntfName_ptrA dumb pointer representation of the object reference for IntfName. This pointer has the semantics of IntfName *. However, for standards compliance and portability you must always use IntfName_ptr as the type of the dumb pointer.
IntfName_varA smart pointer representation ...

Get Pure CORBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.