Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

oOrient Class Reference

#include <oOrient.h>

List of all members.

Public Methods

 oOrient ()
 ~oOrient ()

Static Public Methods

void init ()
void deinit ()
bool is_ready ()
void check_ready ()
void setCacheSize (oUInt4 iSize)
oUInt4 getCacheSize ()
void setCachePolicy (const oObjectStreamCache::cachePolicies iPolicy)
oObjectStreamCache::cachePolicies getCachePolicy ()
oSessioncreateSession (d_String iName, oThread::tEntry iEntryPoint, oThread::tArgument iArg, oUInt2 iFlag=0)
bool waitSessions (d_String iSessionName="")
void setTransMaxObjs (oUInt4 iSize)
oUInt4 getTransMaxObjs ()
char getType (void)


Detailed Description

oOrient is the main class of the Orient ODBMS environment.

ORIENT ENVIRONMENT: Before to use Orient ODBMS the client application must initialize the Orient ODBMS engine.

In Windows® systems this operation is executed automatically at startup of the application before the main() function, when the user client application links the Orient ODBMS library. On application ending the library is detached and the shutdown procedure of the Orient ODBMS environment is called automatically.

In other platforms the client application must explicitly initialize and deinitialize the Orient environment before to use any Orient ODBMS APIs. To initialize the Orient ODBMS environment the user application had to call the oOrient::init() static method. When the application ends to use Orient ODBMS can call the oOrient::deinit() static method to free Orient resources.

The simpler method is defining a variable of type oOrient as first thing inside the main() function. The oOrient constructor calls init() and the destructor calls deinit(). In this way the Orient environment will be initialized when the variable will be out-of-scope.

For more information see the example below.

CLIENT CACHE: Each client application that use Orient has a local object cache. The default size of the cache is of 512 objects. Is possible to modify the client cache size calling oOrient::setCacheSize(). This permits a major reuse of objects already loaded.

MULTI-SESSION MANAGEMENT: In the multi-thread version of Orient ODBMS client libraries are available sessions to handle parallel multi-threads access to Orient ODBMS engine.

oOrient is entry-point the class for Session management.

USAGE: oOrient orient_env;

Where:

: Is the name of variable of type oOrient.

EXAMPLES: int main( int argc, char* argv[] ) { * START THE ORIENT ENVIRONMENT (OPTIONAL IN WIN32 SYSTEMS) * WHEN THE VARIABLE WILL BE OUT OF SCOPE THE ENVIRONMENT * WILL BE DEINITIALIZED. oOrient orient_env;

... }

ODMG: Extension


Constructor & Destructor Documentation

oOrient::oOrient  
 

Default constructor.

Initializes the Orient ODBMS environment calling the init() method.

oOrient::~oOrient  
 

Destructor.

Deinitializes the Orient ODBMS environment calling the deinit() method.


Member Function Documentation

void oOrient::check_ready   [inline, static]
 

Check the status of Orient ODBMS engine.

It throws a d_Error_OrientNotInit exception if the Orient ODBMS environment is not yet initialized.

SEE ALSO: is_ready()

oSession * oOrient::createSession d_String    iName,
oThread::tEntry    iEntryPoint,
oThread::tArgument    iArg,
oUInt2    iFlag = 0
[static]
 

Creates a new session.

Creates a new session called . This method creates a new thread associated to the session. The thread starts at function passing as argument.

Optional flags can be specified for the new thread. Now are supported these flags:

flagDetached: create the thread as detached. In this the thread (and therefore the session) cannot be waited. The benefits of detached threads are that can be instanced much more rather than "joinable" threads.

This method returns the new session created.

This method returns immediately after that the new session is created, because the new session is executed asynchronously in a new thread.

SEE ALSO: waitSessions ()

void oOrient::deinit   [static]
 

Shutdowns Orient ODBMS environment.

Must be called after the use of Orient ODBMS. It's useful to free Orient ODBMS resources (local object cache, etc).

SEE ALSO: ~oOrient(), init()

oObjectStreamCache::cachePolicies oOrient::getCachePolicy   [inline, static]
 

Get the current cache policy. By default is unpinned

SEE ALSO: setCachePolicy()

oUInt4 oOrient::getCacheSize   [static]
 

Returns the Local Client Cache size in objects.

By default is equals to 512.

SEE ALSO: setCacheSize(), d_Object::pin(), d_Object::unpin()

oUInt4 oOrient::getTransMaxObjs   [static]
 

char oOrient::getType void    [static]
 

void oOrient::init   [static]
 

Initializes the Orient ODBMS environment.

Must be called before to use any Orient ODBMS APIs.

SEE ALSO: oOrient(), deinit()

bool oOrient::is_ready   [inline, static]
 

Check the status of Orient ODBMS engine.

It returns true if the Orient ODBMS environment is initialized, otherwise false.

SEE ALSO: check_ready()

void oOrient::setCachePolicy const oObjectStreamCache::cachePolicies    iPolicy [static]
 

Set the cache policy for new objects created. By default is unpinned that means that all objects will be created as unpinned.

The user application can change at run-time the cache policy.

SEE ALSO: getCachePolicy()

void oOrient::setCacheSize oUInt4    iSize [static]
 

Sets the Local Client Cache size.

Sets the Local Client Cache size to objects. By default is 512. This permits a major reuse of objects already loaded.

The user application can change at run-time the cache size.

SEE ALSO: getCacheSize(), d_Object::pin(), d_Object::unpin()

void oOrient::setTransMaxObjs oUInt4    iSize [static]
 

bool oOrient::waitSessions d_String    iSessionName = "" [static]
 

Wait for one or more session to finish.

Wait for one or more session called to finish.

If is empty, then are waited all the session registered.

If not specified any name, are waited all the sessions registered.

SEE ALSO: createSession ()


Friends And Related Function Documentation

friend class oSegment [friend]
 

friend class oSessionManager [friend]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 29 17:12:16 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1