class DD_factory

Class DD_factory: Class to handle create and delete of DDs.

Public Methods

[more] DD_factory()
(only) ctor
[more] ~DD_factory()
dtor, calls cleanup
[more]DD* create_dd( const char* dd_name = DD::pccDefaultDDName, const char* mode = "r", const char* config_file = NULL )
Creates a DD system.
[more]DD* get_dd( const char* dd_name ) const
Given the name of the DD system, return pointer to it.
[more]int delete_dd( const char* dd_name )
Deletes the DD system.
[more]int remove_dd( const char* dd_name )
Removes the DD system.
[more]static void cleanup()
static cleanup member function.


Documentation

Class DD_factory: Class to handle create and delete of DDs. Its main purpose is to keep track which DDs have been created or to which DDs the process has been attached. This is done using static variables nDDs and theDDs. Atexit we call the cleanup routine that makes sure that we detached from all DDs (and deletes them if necesary).

Comments:

Modifications:

o DD_factory()
(only) ctor

o ~DD_factory()
dtor, calls cleanup

oDD* create_dd( const char* dd_name = DD::pccDefaultDDName, const char* mode = "r", const char* config_file = NULL )
Creates a DD system. Using this memberfunction garantees that the DD system will be properly detached/deleted when the process exits. The arguments are:
Parameters:
dd_name - : name of the DD system
mode - : "w" to create the DD if it doesn't exits, "r" (=default): attaches to the DD
config_file - : (optional) configuration file of the DD @ return Pointer to the DD system or NULL

oDD* get_dd( const char* dd_name ) const
Given the name of the DD system, return pointer to it.
Returns:
Pointer *DD or NULL if we never attached the to the system

oint delete_dd( const char* dd_name )
Deletes the DD system. Note: delete_dd does only detach the current process from the DD system if there are still other processes attached to it. Removes the IPC resources if we are the last process.
Returns:
ddcSuccess if ok, ddcFailure if we never attached/created the DD system

oint remove_dd( const char* dd_name )
Removes the DD system. In contrast to delete_dd we now enforce the removal (cleanup) of all IPC resources
Returns:
ddcSuccess if ok, ddcFailure if we never attached/created the DD system

ostatic void cleanup()
static cleanup member function. This member function is called at exit and makes sure that all connections to existing DD systems are closed


This class has no child classes.
Author:
C.Witzig
Date: Mar 17, 98
Version:
Last update: Mar 17, 98

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.