\hypertarget{opal__object_8h}{\section{opal/class/opal\+\_\+object.h File Reference}
\label{opal__object_8h}\index{opal/class/opal\+\_\+object.\+h@{opal/class/opal\+\_\+object.\+h}}
}


A simple C-\/language object-\/oriented system with single inheritance and ownership-\/based memory management using a retain/release model.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$assert.\+h$>$}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structopal__class__t}{opal\+\_\+class\+\_\+t}
\begin{DoxyCompactList}\small\item\em Class descriptor. \end{DoxyCompactList}\item 
struct \hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t}
\begin{DoxyCompactList}\small\item\em Base object. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{opal__object_8h_affc639d551b333a608c5a216564256ae}{O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T}(B\+A\+S\+E\+\_\+\+C\+L\+A\+S\+S)~\{ \hyperlink{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}(B\+A\+S\+E\+\_\+\+C\+L\+A\+S\+S), 1 \}
\begin{DoxyCompactList}\small\item\em For static initializations of O\+B\+Jects. \end{DoxyCompactList}\item 
\#define \hyperlink{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}(N\+A\+M\+E)~(\&(N\+A\+M\+E \#\# \+\_\+class))
\begin{DoxyCompactList}\small\item\em Return a pointer to the class descriptor associated with a class type. \end{DoxyCompactList}\item 
\#define \hyperlink{opal__object_8h_a53b8786261d8efc63e39b93039e5479b}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}(N\+A\+M\+E, P\+A\+R\+E\+N\+T, C\+O\+N\+S\+T\+R\+U\+C\+T\+O\+R, D\+E\+S\+T\+R\+U\+C\+T\+O\+R)
\begin{DoxyCompactList}\small\item\em Static initializer for a class descriptor. \end{DoxyCompactList}\item 
\#define \hyperlink{opal__object_8h_afbfd55c7df4a318247f453c9599d2d17}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N}(N\+A\+M\+E)~extern \hyperlink{structopal__class__t}{opal\+\_\+class\+\_\+t} N\+A\+M\+E \#\# \+\_\+class
\begin{DoxyCompactList}\small\item\em Declaration for class descriptor. \end{DoxyCompactList}\item 
\hypertarget{opal__object_8h_ae6d08b4e42f802d275a8746cbc914af6}{\#define {\bfseries O\+B\+J\+\_\+\+N\+E\+W}(type)~((type $\ast$) \hyperlink{opal__object_8h_aee766008321f02e99976831a0a9f08de}{opal\+\_\+obj\+\_\+new}(\hyperlink{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}(type)))}\label{opal__object_8h_ae6d08b4e42f802d275a8746cbc914af6}

\item 
\#define \hyperlink{opal__object_8h_a67f8f5772cbe2caccc9b38fb435dfaf2}{O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N}(object)~\hyperlink{opal__object_8h_afd5db53faf63d222c65371e46ba2d282}{opal\+\_\+obj\+\_\+update}((\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$) (object), 1);
\begin{DoxyCompactList}\small\item\em Retain an object (by incrementing its reference count) \end{DoxyCompactList}\item 
\hypertarget{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{\#define \hyperlink{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{O\+B\+J\+\_\+\+R\+E\+M\+E\+M\+B\+E\+R\+\_\+\+F\+I\+L\+E\+\_\+\+A\+N\+D\+\_\+\+L\+I\+N\+E\+N\+O}(O\+B\+J\+E\+C\+T, F\+I\+L\+E, L\+I\+N\+E\+N\+O)}\label{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}

\begin{DoxyCompactList}\small\item\em Helper macro for the debug mode to store the locations where the status of an object change. \end{DoxyCompactList}\item 
\hypertarget{opal__object_8h_ab48f77003253ee977953b99bc24f44f9}{\#define {\bfseries O\+B\+J\+\_\+\+S\+E\+T\+\_\+\+M\+A\+G\+I\+C\+\_\+\+I\+D}(O\+B\+J\+E\+C\+T, V\+A\+L\+U\+E)}\label{opal__object_8h_ab48f77003253ee977953b99bc24f44f9}

\item 
\#define \hyperlink{opal__object_8h_abc1e3a4a6f319e31f74659a2f073891a}{O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E}(object)
\begin{DoxyCompactList}\small\item\em Release an object (by decrementing its reference count). \end{DoxyCompactList}\item 
\#define \hyperlink{opal__object_8h_a0a46f73171b044c7cafbf299d47611d3}{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T}(object, type)
\begin{DoxyCompactList}\small\item\em Construct (initialize) objects that are not dynamically allocated. \end{DoxyCompactList}\item 
\#define {\bfseries O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L}(object, type)
\item 
\#define \hyperlink{opal__object_8h_a2ff6f75b8753f183bd47d3b8356311f6}{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T}(object)
\begin{DoxyCompactList}\small\item\em Destruct (finalize) an object that is not dynamically allocated. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{opal__object_8h_a23121c914121138b6132c6f6c08c33b7}{typedef typedef\+B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S \\*
struct \hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} {\bfseries opal\+\_\+object\+\_\+t}}\label{opal__object_8h_a23121c914121138b6132c6f6c08c33b7}

\item 
\hypertarget{opal__object_8h_a9b9d1e7b64ae43311c4bbe219137df0a}{typedef struct \hyperlink{structopal__class__t}{opal\+\_\+class\+\_\+t} {\bfseries opal\+\_\+class\+\_\+t}}\label{opal__object_8h_a9b9d1e7b64ae43311c4bbe219137df0a}

\item 
\hypertarget{opal__object_8h_acc700811e042f079da369414a4f6c33a}{typedef void($\ast$ {\bfseries opal\+\_\+construct\+\_\+t} )(\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$)}\label{opal__object_8h_acc700811e042f079da369414a4f6c33a}

\item 
\hypertarget{opal__object_8h_a7b364e0fcf930b6a1880d04e7af16dbb}{typedef void($\ast$ {\bfseries opal\+\_\+destruct\+\_\+t} )(\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$)}\label{opal__object_8h_a7b364e0fcf930b6a1880d04e7af16dbb}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$ \hyperlink{opal__object_8h_aee766008321f02e99976831a0a9f08de}{opal\+\_\+obj\+\_\+new} (\hyperlink{structopal__class__t}{opal\+\_\+class\+\_\+t} $\ast$cls)
\begin{DoxyCompactList}\small\item\em Create an object\+: dynamically allocate storage and run the class constructor. \end{DoxyCompactList}\item 
\hypertarget{opal__object_8h_a1160ace06672d5d8560f78218430d5a0}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C {\bfseries O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t})}\label{opal__object_8h_a1160ace06672d5d8560f78218430d5a0}

\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{opal__object_8h_acade18873234986e4d5b28fc93c886b1}{opal\+\_\+class\+\_\+initialize} (\hyperlink{structopal__class__t}{opal\+\_\+class\+\_\+t} $\ast$)
\begin{DoxyCompactList}\small\item\em Lazy initialization of class descriptor. \end{DoxyCompactList}\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__object_8h_a9567993bd0db5fd6d77893adfb5cf03b}{opal\+\_\+class\+\_\+finalize} (void)
\begin{DoxyCompactList}\small\item\em Shut down the class system and release all memory. \end{DoxyCompactList}\item 
static void \hyperlink{opal__object_8h_abdbd427107eeea2f28fd97dd986df0a6}{opal\+\_\+obj\+\_\+run\+\_\+constructors} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$object)
\begin{DoxyCompactList}\small\item\em Run the hierarchy of class constructors for this object, in a parent-\/first order. \end{DoxyCompactList}\item 
static void \hyperlink{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{opal\+\_\+obj\+\_\+run\+\_\+destructors} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$object)
\begin{DoxyCompactList}\small\item\em Run the hierarchy of class destructors for this object, in a parent-\/last order. \end{DoxyCompactList}\item 
static int \hyperlink{opal__object_8h_afd5db53faf63d222c65371e46ba2d282}{opal\+\_\+obj\+\_\+update} (\hyperlink{structopal__object__t}{opal\+\_\+object\+\_\+t} $\ast$object, int inc) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+always\+\_\+inline\+\_\+\+\_\+
\begin{DoxyCompactList}\small\item\em Atomically update the object's reference count by some increment. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A simple C-\/language object-\/oriented system with single inheritance and ownership-\/based memory management using a retain/release model. 

A class consists of a struct and singly-\/instantiated class descriptor. The first element of the struct must be the parent class's struct. The class descriptor must be given a well-\/known name based upon the class struct name (if the struct is sally\+\_\+t, the class descriptor should be sally\+\_\+t\+\_\+class) and must be statically initialized as discussed below.

(a) To define a class

In a interface (.h) file, define the class. The first element should always be the parent class, for example 
\begin{DoxyCode}
\textcolor{keyword}{struct }sally\_t
\{
  parent\_t parent;
  \textcolor{keywordtype}{void} *first\_member;
  ...
\};
\textcolor{keyword}{typedef} \textcolor{keyword}{struct }sally\_t sally\_t;

\hyperlink{opal__object_8h_afbfd55c7df4a318247f453c9599d2d17}{OBJ\_CLASS\_DECLARATION}(sally\_t);
\end{DoxyCode}
 All classes must have a parent which is also class.

In an implementation (.c) file, instantiate a class descriptor for the class like this\+: 
\begin{DoxyCode}
\hyperlink{opal__object_8h_a53b8786261d8efc63e39b93039e5479b}{OBJ\_CLASS\_INSTANCE}(sally\_t, parent\_t, sally\_construct, sally\_destruct);
\end{DoxyCode}
 This macro actually expands to 
\begin{DoxyCode}
\hyperlink{structopal__class__t}{opal\_class\_t} sally\_t\_class = \{
  \textcolor{stringliteral}{"sally\_t"},
  \hyperlink{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{OBJ\_CLASS}(parent\_t),  \textcolor{comment}{// pointer to parent\_t\_class}
  sally\_construct,
  sally\_destruct,
  0, 0, NULL, NULL,
  \textcolor{keyword}{sizeof} (\textcolor{stringliteral}{"sally\_t"})
\};
\end{DoxyCode}
 This variable should be declared in the interface (.h) file using the O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N macro as shown above.

sally\+\_\+construct, and sally\+\_\+destruct are function pointers to the constructor and destructor for the class and are best defined as static functions in the implementation file. N\+U\+L\+L pointers maybe supplied instead.

Other class methods may be added to the struct.

(b) Class instantiation\+: dynamic

To create a instance of a class (an object) use O\+B\+J\+\_\+\+N\+E\+W\+: 
\begin{DoxyCode}
sally\_t *sally = OBJ\_NEW(sally\_t);
\end{DoxyCode}
 which allocates memory of sizeof(sally\+\_\+t) and runs the class's constructors.

Use O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N, O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E to do reference-\/count-\/based memory management\+: 
\begin{DoxyCode}
\hyperlink{opal__object_8h_a67f8f5772cbe2caccc9b38fb435dfaf2}{OBJ\_RETAIN}(sally);
\hyperlink{opal__object_8h_abc1e3a4a6f319e31f74659a2f073891a}{OBJ\_RELEASE}(sally);
\hyperlink{opal__object_8h_abc1e3a4a6f319e31f74659a2f073891a}{OBJ\_RELEASE}(sally);
\end{DoxyCode}
 When the reference count reaches zero, the class's destructor, and those of its parents, are run and the memory is freed.

N.\+B. There is no explicit free/delete method for dynamic objects in this model.

(c) Class instantiation\+: static

For an object with static (or stack) allocation, it is only necessary to initialize the memory, which is done using O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+: 
\begin{DoxyCode}
sally\_t sally;

\hyperlink{opal__object_8h_a0a46f73171b044c7cafbf299d47611d3}{OBJ\_CONSTRUCT}(&sally, sally\_t);
\end{DoxyCode}
 The retain/release model is not necessary here, but before the object goes out of scope, O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T should be run to release initialized resources\+: 
\begin{DoxyCode}
\hyperlink{opal__object_8h_a2ff6f75b8753f183bd47d3b8356311f6}{OBJ\_DESTRUCT}(&sally);
\end{DoxyCode}
 

\subsection{Macro Definition Documentation}
\hypertarget{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+C\+L\+A\+S\+S@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}}
\index{O\+B\+J\+\_\+\+C\+L\+A\+S\+S@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+C\+L\+A\+S\+S}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+C\+L\+A\+S\+S(
\begin{DoxyParamCaption}
\item[{}]{N\+A\+M\+E}
\end{DoxyParamCaption}
)~(\&(N\+A\+M\+E \#\# \+\_\+class))}}\label{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}


Return a pointer to the class descriptor associated with a class type. 


\begin{DoxyParams}{Parameters}
{\em N\+A\+M\+E} & Name of class \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to class descriptor 
\end{DoxyReturn}


Referenced by mca\+\_\+allocator\+\_\+basic\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+elan\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+mx\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+sctp\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+self\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+tcp\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+udapl\+\_\+init(), mca\+\_\+pml\+\_\+bfo\+\_\+enable(), mca\+\_\+pml\+\_\+csum\+\_\+enable(), mca\+\_\+pml\+\_\+ob1\+\_\+enable(), and ompi\+\_\+rb\+\_\+tree\+\_\+construct().

\hypertarget{opal__object_8h_afbfd55c7df4a318247f453c9599d2d17}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N}}
\index{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+D\+E\+C\+L\+A\+R\+A\+T\+I\+O\+N(
\begin{DoxyParamCaption}
\item[{}]{N\+A\+M\+E}
\end{DoxyParamCaption}
)~extern {\bf opal\+\_\+class\+\_\+t} N\+A\+M\+E \#\# \+\_\+class}}\label{opal__object_8h_afbfd55c7df4a318247f453c9599d2d17}


Declaration for class descriptor. 


\begin{DoxyParams}{Parameters}
{\em N\+A\+M\+E} & Name of class\\
\hline
\end{DoxyParams}
Put this in N\+A\+M\+E.\+h \hypertarget{opal__object_8h_a53b8786261d8efc63e39b93039e5479b}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}}
\index{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E@{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+C\+L\+A\+S\+S\+\_\+\+I\+N\+S\+T\+A\+N\+C\+E(
\begin{DoxyParamCaption}
\item[{}]{N\+A\+M\+E, }
\item[{}]{P\+A\+R\+E\+N\+T, }
\item[{}]{C\+O\+N\+S\+T\+R\+U\+C\+T\+O\+R, }
\item[{}]{D\+E\+S\+T\+R\+U\+C\+T\+O\+R}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_a53b8786261d8efc63e39b93039e5479b}
{\bfseries Value\+:}
\begin{DoxyCode}
\hyperlink{structopal__class__t}{opal\_class\_t} NAME ## \_class = \{                                     \(\backslash\)
\textcolor{preprocessor}{        # NAME,                                                         \(\backslash\)}
\textcolor{preprocessor}{        OBJ\_CLASS(PARENT),                                              \(\backslash\)}
\textcolor{preprocessor}{        (opal\_construct\_t) CONSTRUCTOR,                                 \(\backslash\)}
\textcolor{preprocessor}{        (opal\_destruct\_t) DESTRUCTOR,                                   \(\backslash\)}
\textcolor{preprocessor}{        0, 0, NULL, NULL,                                               \(\backslash\)}
\textcolor{preprocessor}{        sizeof(NAME)                                                    \(\backslash\)}
\textcolor{preprocessor}{    \}}
\end{DoxyCode}


Static initializer for a class descriptor. 


\begin{DoxyParams}{Parameters}
{\em N\+A\+M\+E} & Name of class \\
\hline
{\em P\+A\+R\+E\+N\+T} & Name of parent class \\
\hline
{\em C\+O\+N\+S\+T\+R\+U\+C\+T\+O\+R} & Pointer to constructor \\
\hline
{\em D\+E\+S\+T\+R\+U\+C\+T\+O\+R} & Pointer to destructor\\
\hline
\end{DoxyParams}
Put this in N\+A\+M\+E.\+c \hypertarget{opal__object_8h_a0a46f73171b044c7cafbf299d47611d3}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T@{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T}}
\index{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T@{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T(
\begin{DoxyParamCaption}
\item[{}]{object, }
\item[{}]{type}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_a0a46f73171b044c7cafbf299d47611d3}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{                                                            \(\backslash\)
    OBJ\_CONSTRUCT\_INTERNAL((\textcolor{keywordtype}{object}), \hyperlink{opal__object_8h_a2e9f4240c24cdf18650036bc9e932f15}{OBJ\_CLASS}(type));          \(\backslash\)
\} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}


Construct (initialize) objects that are not dynamically allocated. 


\begin{DoxyParams}{Parameters}
{\em object} & Pointer to the object \\
\hline
{\em type} & The object type \\
\hline
\end{DoxyParams}


Referenced by mca\+\_\+allocator\+\_\+basic\+\_\+component\+\_\+init(), mca\+\_\+allocator\+\_\+bucket\+\_\+init(), mca\+\_\+base\+\_\+param\+\_\+init(), mca\+\_\+btl\+\_\+base\+\_\+open(), mca\+\_\+btl\+\_\+elan\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+gm\+\_\+component\+\_\+open(), mca\+\_\+btl\+\_\+mx\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+self\+\_\+component\+\_\+open(), mca\+\_\+btl\+\_\+ud\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+ud\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+udapl\+\_\+component\+\_\+open(), mca\+\_\+btl\+\_\+udapl\+\_\+init(), mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+coll\+\_\+sm\+\_\+bcast\+\_\+intra(), mca\+\_\+io\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+mpool\+\_\+base\+\_\+open(), mca\+\_\+oob\+\_\+base\+\_\+open(), mca\+\_\+pml\+\_\+bfo\+\_\+comm\+\_\+init\+\_\+size(), mca\+\_\+pml\+\_\+bfo\+\_\+enable(), mca\+\_\+pml\+\_\+csum\+\_\+comm\+\_\+init\+\_\+size(), mca\+\_\+pml\+\_\+csum\+\_\+enable(), mca\+\_\+pml\+\_\+ob1\+\_\+comm\+\_\+init\+\_\+size(), mca\+\_\+pml\+\_\+ob1\+\_\+enable(), mca\+\_\+rcache\+\_\+base\+\_\+open(), mca\+\_\+rcache\+\_\+rb\+\_\+module\+\_\+init(), mca\+\_\+rcache\+\_\+vma\+\_\+module\+\_\+init(), ompi\+\_\+attr\+\_\+init(), ompi\+\_\+errcode\+\_\+intern\+\_\+init(), ompi\+\_\+errhandler\+\_\+init(), ompi\+\_\+group\+\_\+init(), ompi\+\_\+modex\+\_\+recv\+\_\+key\+\_\+value(), ompi\+\_\+modex\+\_\+send\+\_\+key\+\_\+value(), ompi\+\_\+mpi\+\_\+errcode\+\_\+init(), ompi\+\_\+mpi\+\_\+init(), ompi\+\_\+op\+\_\+base\+\_\+find\+\_\+available(), ompi\+\_\+osc\+\_\+base\+\_\+open(), ompi\+\_\+osc\+\_\+base\+\_\+process\+\_\+op(), ompi\+\_\+proc\+\_\+init(), ompi\+\_\+rb\+\_\+tree\+\_\+construct(), ompi\+\_\+request\+\_\+init(), ompi\+\_\+wait\+\_\+for\+\_\+debugger(), opal\+\_\+cmd\+\_\+line\+\_\+create(), opal\+\_\+cr\+\_\+init(), opal\+\_\+dss\+\_\+open(), opal\+\_\+hash\+\_\+table\+\_\+init(), opal\+\_\+malloc\+\_\+init(), opal\+\_\+output\+\_\+init(), orte\+\_\+ess\+\_\+base\+\_\+open(), orte\+\_\+ess\+\_\+base\+\_\+orted\+\_\+setup(), orte\+\_\+iof\+\_\+base\+\_\+open(), orte\+\_\+notifier\+\_\+base\+\_\+open(), orte\+\_\+odls\+\_\+base\+\_\+open(), orte\+\_\+plm\+\_\+base\+\_\+open(), orte\+\_\+plm\+\_\+base\+\_\+orted\+\_\+exit(), orte\+\_\+register\+\_\+params(), orte\+\_\+rmaps\+\_\+base\+\_\+open(), orte\+\_\+rml\+\_\+base\+\_\+open(), orte\+\_\+sensor\+\_\+base\+\_\+open(), orte\+\_\+sensor\+\_\+base\+\_\+select(), orte\+\_\+show\+\_\+help\+\_\+init(), orte\+\_\+show\+\_\+help\+\_\+norender(), orte\+\_\+show\+\_\+help\+\_\+suppress(), and orte\+\_\+util\+\_\+add\+\_\+hostfile\+\_\+nodes().

\hypertarget{opal__object_8h_aa7f51bc31142aeaca00abba0d29ac0e1}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L@{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L}}
\index{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L@{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T\+\_\+\+I\+N\+T\+E\+R\+N\+A\+L(
\begin{DoxyParamCaption}
\item[{}]{object, }
\item[{}]{type}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_aa7f51bc31142aeaca00abba0d29ac0e1}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{                                                                \(\backslash\)
    OBJ\_SET\_MAGIC\_ID((\textcolor{keywordtype}{object}), OPAL\_OBJ\_MAGIC\_ID);              \(\backslash\)
    if (0 == (type)->cls\_initialized) \{                             \hyperlink{opal__object_8h_acade18873234986e4d5b28fc93c886b1}{\(\backslash\)}
\hyperlink{opal__object_8h_acade18873234986e4d5b28fc93c886b1}{        opal\_class\_initialize}((type));                              \(\backslash\)
    \}                                                               \(\backslash\)
    ((\hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}))->obj\_class = (type);               \(\backslash\)
    ((\hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}))->obj\_reference\_count = 1;          
      \hyperlink{opal__object_8h_abdbd427107eeea2f28fd97dd986df0a6}{\(\backslash\)}
\hyperlink{opal__object_8h_abdbd427107eeea2f28fd97dd986df0a6}{    opal\_obj\_run\_constructors}((\hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}));       
         \hyperlink{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{\(\backslash\)}
\hyperlink{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{    OBJ\_REMEMBER\_FILE\_AND\_LINENO}( \textcolor{keywordtype}{object}, \_\_FILE\_\_, \_\_LINE\_\_ ); \(\backslash\)
\} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}
\hypertarget{opal__object_8h_a2ff6f75b8753f183bd47d3b8356311f6}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T@{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T}}
\index{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T@{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T(
\begin{DoxyParamCaption}
\item[{}]{object}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_a2ff6f75b8753f183bd47d3b8356311f6}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{                                                            \hyperlink{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{\(\backslash\)}
\hyperlink{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{    opal\_obj\_run\_destructors}((\hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}));       
      \hyperlink{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{\(\backslash\)}
\hyperlink{opal__object_8h_a4d2cbc61670073ff6c315a9087415208}{    OBJ\_REMEMBER\_FILE\_AND\_LINENO}( \textcolor{keywordtype}{object}, \_\_FILE\_\_, \_\_LINE\_\_ ); \(\backslash\)
\} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}


Destruct (finalize) an object that is not dynamically allocated. 


\begin{DoxyParams}{Parameters}
{\em object} & Pointer to the object \\
\hline
\end{DoxyParams}


Referenced by mca\+\_\+allocator\+\_\+basic\+\_\+finalize(), mca\+\_\+base\+\_\+param\+\_\+finalize(), mca\+\_\+btl\+\_\+elan\+\_\+component\+\_\+close(), mca\+\_\+btl\+\_\+gm\+\_\+finalize(), mca\+\_\+btl\+\_\+mx\+\_\+finalize(), mca\+\_\+btl\+\_\+self\+\_\+component\+\_\+close(), mca\+\_\+btl\+\_\+template\+\_\+finalize(), mca\+\_\+btl\+\_\+ud\+\_\+component\+\_\+init(), mca\+\_\+btl\+\_\+ud\+\_\+finalize(), mca\+\_\+btl\+\_\+udapl\+\_\+finalize(), mca\+\_\+coll\+\_\+base\+\_\+close(), mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+io\+\_\+base\+\_\+close(), mca\+\_\+io\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+mpool\+\_\+gpusm\+\_\+finalize(), mca\+\_\+mpool\+\_\+grdma\+\_\+finalize(), mca\+\_\+mpool\+\_\+rdma\+\_\+finalize(), mca\+\_\+mpool\+\_\+rgpusm\+\_\+finalize(), ompi\+\_\+errcode\+\_\+intern\+\_\+finalize(), ompi\+\_\+errhandler\+\_\+finalize(), ompi\+\_\+group\+\_\+finalize(), ompi\+\_\+modex\+\_\+recv\+\_\+key\+\_\+value(), ompi\+\_\+modex\+\_\+send\+\_\+key\+\_\+value(), ompi\+\_\+mpi\+\_\+errcode\+\_\+finalize(), ompi\+\_\+mpi\+\_\+finalize(), ompi\+\_\+op\+\_\+base\+\_\+close(), ompi\+\_\+op\+\_\+base\+\_\+find\+\_\+available(), ompi\+\_\+op\+\_\+finalize(), ompi\+\_\+osc\+\_\+base\+\_\+process\+\_\+op(), ompi\+\_\+proc\+\_\+finalize(), ompi\+\_\+rb\+\_\+tree\+\_\+destruct(), ompi\+\_\+request\+\_\+finalize(), ompi\+\_\+wait\+\_\+for\+\_\+debugger(), opal\+\_\+cr\+\_\+finalize(), opal\+\_\+dss\+\_\+close(), opal\+\_\+malloc\+\_\+finalize(), opal\+\_\+output\+\_\+finalize(), orte\+\_\+ess\+\_\+base\+\_\+close(), orte\+\_\+plm\+\_\+base\+\_\+orted\+\_\+exit(), orte\+\_\+register\+\_\+params(), orte\+\_\+rmaps\+\_\+base\+\_\+close(), orte\+\_\+rml\+\_\+base\+\_\+close(), orte\+\_\+sensor\+\_\+base\+\_\+select(), orte\+\_\+show\+\_\+help\+\_\+finalize(), orte\+\_\+show\+\_\+help\+\_\+norender(), orte\+\_\+show\+\_\+help\+\_\+suppress(), and orte\+\_\+util\+\_\+add\+\_\+hostfile\+\_\+nodes().

\hypertarget{opal__object_8h_abc1e3a4a6f319e31f74659a2f073891a}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E@{O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E}}
\index{O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E@{O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E(
\begin{DoxyParamCaption}
\item[{}]{object}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_abc1e3a4a6f319e31f74659a2f073891a}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do} \{                                                                \(\backslash\)
        if (0 == \hyperlink{opal__object_8h_afd5db53faf63d222c65371e46ba2d282}{opal\_obj\_update}((\hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}), -1)) \{     
      \hyperlink{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{\(\backslash\)}
\hyperlink{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{            opal\_obj\_run\_destructors}((
      \hyperlink{structopal__object__t}{opal\_object\_t} *) (\textcolor{keywordtype}{object}));       \(\backslash\)
            free(\textcolor{keywordtype}{object});                                               \(\backslash\)
            object = NULL;                                              \(\backslash\)
        \}                                                               \(\backslash\)
    \} \textcolor{keywordflow}{while} (0)
\end{DoxyCode}


Release an object (by decrementing its reference count). 

If the reference count reaches zero, destruct (finalize) the object and free its storage.

Note\+: If the object is freed, then the value of the pointer is set to N\+U\+L\+L.


\begin{DoxyParams}{Parameters}
{\em object} & Pointer to the object \\
\hline
\end{DoxyParams}


Referenced by mca\+\_\+base\+\_\+param\+\_\+dump\+\_\+release(), mca\+\_\+base\+\_\+param\+\_\+finalize(), mca\+\_\+btl\+\_\+gm\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+mx\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+sctp\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+sctp\+\_\+del\+\_\+procs(), mca\+\_\+btl\+\_\+sctp\+\_\+finalize(), mca\+\_\+btl\+\_\+tcp\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+tcp\+\_\+del\+\_\+procs(), mca\+\_\+btl\+\_\+tcp\+\_\+finalize(), mca\+\_\+btl\+\_\+template\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+template\+\_\+free(), mca\+\_\+btl\+\_\+ud\+\_\+add\+\_\+procs(), mca\+\_\+btl\+\_\+ud\+\_\+del\+\_\+procs(), mca\+\_\+btl\+\_\+udapl\+\_\+add\+\_\+procs(), mca\+\_\+coll\+\_\+base\+\_\+comm\+\_\+select(), mca\+\_\+coll\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+io\+\_\+base\+\_\+delete(), mca\+\_\+io\+\_\+base\+\_\+file\+\_\+select(), mca\+\_\+io\+\_\+base\+\_\+find\+\_\+available(), mca\+\_\+mpool\+\_\+grdma\+\_\+finalize(), mca\+\_\+oob\+\_\+tcp\+\_\+fini(), mca\+\_\+oob\+\_\+tcp\+\_\+set\+\_\+addr(), ompi\+\_\+attr\+\_\+copy\+\_\+all(), ompi\+\_\+attr\+\_\+delete(), ompi\+\_\+attr\+\_\+finalize(), ompi\+\_\+attr\+\_\+free\+\_\+keyval(), ompi\+\_\+errhandler\+\_\+create(), ompi\+\_\+group\+\_\+allocate(), ompi\+\_\+group\+\_\+decrement\+\_\+proc\+\_\+count(), ompi\+\_\+group\+\_\+finalize(), ompi\+\_\+group\+\_\+free(), ompi\+\_\+mpi\+\_\+errcode\+\_\+finalize(), ompi\+\_\+mpi\+\_\+finalize(), ompi\+\_\+op\+\_\+base\+\_\+find\+\_\+available(), ompi\+\_\+op\+\_\+base\+\_\+op\+\_\+select(), ompi\+\_\+op\+\_\+create\+\_\+user(), ompi\+\_\+op\+\_\+finalize(), ompi\+\_\+proc\+\_\+complete\+\_\+init(), ompi\+\_\+proc\+\_\+finalize(), ompi\+\_\+proc\+\_\+refresh(), ompi\+\_\+proc\+\_\+unpack(), ompi\+\_\+request\+\_\+persistent\+\_\+proc\+\_\+null\+\_\+free(), opal\+\_\+carto\+\_\+base\+\_\+duplicate\+\_\+graph\+\_\+fn(), opal\+\_\+carto\+\_\+base\+\_\+free\+\_\+graph\+\_\+fn(), opal\+\_\+cmd\+\_\+line\+\_\+parse(), opal\+\_\+dss\+\_\+close(), opal\+\_\+graph\+\_\+remove\+\_\+vertex(), opal\+\_\+graph\+\_\+spf(), opal\+\_\+hash\+\_\+table\+\_\+remove\+\_\+all(), orte\+\_\+dt\+\_\+std\+\_\+obj\+\_\+release(), orte\+\_\+ess\+\_\+base\+\_\+close(), orte\+\_\+ras\+\_\+base\+\_\+node\+\_\+insert(), orte\+\_\+rmaps\+\_\+base\+\_\+close(), orte\+\_\+rmaps\+\_\+base\+\_\+get\+\_\+target\+\_\+nodes(), orte\+\_\+rml\+\_\+base\+\_\+select(), and orte\+\_\+util\+\_\+add\+\_\+hostfile\+\_\+nodes().

\hypertarget{opal__object_8h_a67f8f5772cbe2caccc9b38fb435dfaf2}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N@{O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N}}
\index{O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N@{O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N(
\begin{DoxyParamCaption}
\item[{}]{object}
\end{DoxyParamCaption}
)~{\bf opal\+\_\+obj\+\_\+update}(({\bf opal\+\_\+object\+\_\+t} $\ast$) (object), 1);}}\label{opal__object_8h_a67f8f5772cbe2caccc9b38fb435dfaf2}


Retain an object (by incrementing its reference count) 


\begin{DoxyParams}{Parameters}
{\em object} & Pointer to the object \\
\hline
\end{DoxyParams}


Referenced by ompi\+\_\+group\+\_\+incl\+\_\+plist(), ompi\+\_\+group\+\_\+increment\+\_\+proc\+\_\+count(), ompi\+\_\+op\+\_\+base\+\_\+op\+\_\+select(), ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+bxor(), ompi\+\_\+op\+\_\+example\+\_\+setup\+\_\+max(), ompi\+\_\+op\+\_\+x86\+\_\+setup\+\_\+sum(), ompi\+\_\+osc\+\_\+base\+\_\+datatype\+\_\+create(), ompi\+\_\+osc\+\_\+base\+\_\+op\+\_\+create(), ompi\+\_\+proc\+\_\+all(), ompi\+\_\+proc\+\_\+self(), orte\+\_\+dt\+\_\+copy\+\_\+job(), orte\+\_\+dt\+\_\+copy\+\_\+node(), orte\+\_\+dt\+\_\+copy\+\_\+proc(), and orte\+\_\+rmaps\+\_\+base\+\_\+get\+\_\+target\+\_\+nodes().

\hypertarget{opal__object_8h_affc639d551b333a608c5a216564256ae}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T@{O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T}}
\index{O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T@{O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+P\+A\+L\+\_\+\+O\+B\+J\+\_\+\+S\+T\+A\+T\+I\+C\+\_\+\+I\+N\+I\+T(
\begin{DoxyParamCaption}
\item[{}]{B\+A\+S\+E\+\_\+\+C\+L\+A\+S\+S}
\end{DoxyParamCaption}
)~\{ {\bf O\+B\+J\+\_\+\+C\+L\+A\+S\+S}(B\+A\+S\+E\+\_\+\+C\+L\+A\+S\+S), 1 \}}}\label{opal__object_8h_affc639d551b333a608c5a216564256ae}


For static initializations of O\+B\+Jects. 


\begin{DoxyParams}{Parameters}
{\em N\+A\+M\+E} & Name of the class to initialize \\
\hline
\end{DoxyParams}


\subsection{Function Documentation}
\hypertarget{opal__object_8h_a9567993bd0db5fd6d77893adfb5cf03b}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+class\+\_\+finalize@{opal\+\_\+class\+\_\+finalize}}
\index{opal\+\_\+class\+\_\+finalize@{opal\+\_\+class\+\_\+finalize}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+class\+\_\+finalize}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+class\+\_\+finalize (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_a9567993bd0db5fd6d77893adfb5cf03b}


Shut down the class system and release all memory. 

This function should be invoked as the A\+B\+S\+O\+L\+U\+T\+E L\+A\+S\+T function to use the class subsystem. It frees all associated memory with A\+L\+L classes, rendering all of them inoperable. It is here so that tools like valgrind and purify don't report still-\/reachable memory upon process termination. 

Referenced by opal\+\_\+finalize\+\_\+util().

\hypertarget{opal__object_8h_acade18873234986e4d5b28fc93c886b1}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+class\+\_\+initialize@{opal\+\_\+class\+\_\+initialize}}
\index{opal\+\_\+class\+\_\+initialize@{opal\+\_\+class\+\_\+initialize}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+class\+\_\+initialize}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+class\+\_\+initialize (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+class\+\_\+t} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{opal__object_8h_acade18873234986e4d5b28fc93c886b1}


Lazy initialization of class descriptor. 

Specifically cache arrays of function pointers for the constructor and destructor hierarchies for this class.


\begin{DoxyParams}{Parameters}
{\em class} & Pointer to class descriptor \\
\hline
\end{DoxyParams}


References opal\+\_\+class\+\_\+t\+::cls\+\_\+construct, opal\+\_\+class\+\_\+t\+::cls\+\_\+construct\+\_\+array, opal\+\_\+class\+\_\+t\+::cls\+\_\+depth, opal\+\_\+class\+\_\+t\+::cls\+\_\+destruct, opal\+\_\+class\+\_\+t\+::cls\+\_\+destruct\+\_\+array, opal\+\_\+class\+\_\+t\+::cls\+\_\+initialized, opal\+\_\+class\+\_\+t\+::cls\+\_\+parent, opal\+\_\+atomic\+\_\+lock(), and opal\+\_\+atomic\+\_\+unlock().



Referenced by opal\+\_\+obj\+\_\+new().

\hypertarget{opal__object_8h_aee766008321f02e99976831a0a9f08de}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+obj\+\_\+new@{opal\+\_\+obj\+\_\+new}}
\index{opal\+\_\+obj\+\_\+new@{opal\+\_\+obj\+\_\+new}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+obj\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}static {\bf opal\+\_\+object\+\_\+t} $\ast$ opal\+\_\+obj\+\_\+new (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+class\+\_\+t} $\ast$}]{cls}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__object_8h_aee766008321f02e99976831a0a9f08de}


Create an object\+: dynamically allocate storage and run the class constructor. 

Create new object\+: dynamically allocate storage and run the class constructor.


\begin{DoxyParams}{Parameters}
{\em type} & Type (class) of the object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to the object
\end{DoxyReturn}
Do not use this function directly\+: use O\+B\+J\+\_\+\+N\+E\+W() instead.


\begin{DoxyParams}{Parameters}
{\em size} & Size of the object \\
\hline
{\em cls} & Pointer to the class descriptor of this object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to the object 
\end{DoxyReturn}


References opal\+\_\+class\+\_\+t\+::cls\+\_\+initialized, opal\+\_\+class\+\_\+t\+::cls\+\_\+sizeof, opal\+\_\+class\+\_\+initialize(), and opal\+\_\+obj\+\_\+run\+\_\+constructors().

\hypertarget{opal__object_8h_abdbd427107eeea2f28fd97dd986df0a6}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+obj\+\_\+run\+\_\+constructors@{opal\+\_\+obj\+\_\+run\+\_\+constructors}}
\index{opal\+\_\+obj\+\_\+run\+\_\+constructors@{opal\+\_\+obj\+\_\+run\+\_\+constructors}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+obj\+\_\+run\+\_\+constructors}]{\setlength{\rightskip}{0pt plus 5cm}static void opal\+\_\+obj\+\_\+run\+\_\+constructors (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+object\+\_\+t} $\ast$}]{object}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__object_8h_abdbd427107eeea2f28fd97dd986df0a6}


Run the hierarchy of class constructors for this object, in a parent-\/first order. 

Do not use this function directly\+: use \hyperlink{opal__object_8h_a0a46f73171b044c7cafbf299d47611d3}{O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T()} instead.

W\+A\+R\+N\+I\+N\+G\+: This implementation relies on a hardwired maximum depth of the inheritance tree!!!

Hardwired for fairly shallow inheritance trees 
\begin{DoxyParams}{Parameters}
{\em size} & Pointer to the object. \\
\hline
\end{DoxyParams}


References opal\+\_\+object\+\_\+t\+::obj\+\_\+class.



Referenced by opal\+\_\+obj\+\_\+new().

\hypertarget{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+obj\+\_\+run\+\_\+destructors@{opal\+\_\+obj\+\_\+run\+\_\+destructors}}
\index{opal\+\_\+obj\+\_\+run\+\_\+destructors@{opal\+\_\+obj\+\_\+run\+\_\+destructors}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+obj\+\_\+run\+\_\+destructors}]{\setlength{\rightskip}{0pt plus 5cm}static void opal\+\_\+obj\+\_\+run\+\_\+destructors (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+object\+\_\+t} $\ast$}]{object}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__object_8h_af8280007d2757e2c68f9fdbfc2c4b22f}


Run the hierarchy of class destructors for this object, in a parent-\/last order. 

Do not use this function directly\+: use \hyperlink{opal__object_8h_a2ff6f75b8753f183bd47d3b8356311f6}{O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T()} instead.


\begin{DoxyParams}{Parameters}
{\em size} & Pointer to the object. \\
\hline
\end{DoxyParams}


References opal\+\_\+object\+\_\+t\+::obj\+\_\+class.

\hypertarget{opal__object_8h_afd5db53faf63d222c65371e46ba2d282}{\index{opal\+\_\+object.\+h@{opal\+\_\+object.\+h}!opal\+\_\+obj\+\_\+update@{opal\+\_\+obj\+\_\+update}}
\index{opal\+\_\+obj\+\_\+update@{opal\+\_\+obj\+\_\+update}!opal\+\_\+object.\+h@{opal\+\_\+object.\+h}}
\subsubsection[{opal\+\_\+obj\+\_\+update}]{\setlength{\rightskip}{0pt plus 5cm}static int opal\+\_\+obj\+\_\+update (
\begin{DoxyParamCaption}
\item[{{\bf opal\+\_\+object\+\_\+t} $\ast$}]{object, }
\item[{int}]{inc}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{opal__object_8h_afd5db53faf63d222c65371e46ba2d282}


Atomically update the object's reference count by some increment. 

This function should not be used directly\+: it is called via the macros O\+B\+J\+\_\+\+R\+E\+T\+A\+I\+N and O\+B\+J\+\_\+\+R\+E\+L\+E\+A\+S\+E


\begin{DoxyParams}{Parameters}
{\em object} & Pointer to the object \\
\hline
{\em inc} & Increment by which to update reference count \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
New value of the reference count 
\end{DoxyReturn}


References opal\+\_\+object\+\_\+t\+::obj\+\_\+reference\+\_\+count.

