OVR_System.h
Go to the documentation of this file.
00001 /************************************************************************************
00002 
00003 PublicHeader:   OVR
00004 Filename    :   OVR_System.h
00005 Content     :   General kernel initialization/cleanup, including that
00006                 of the memory allocator.
00007 Created     :   September 19, 2012
00008 Notes       : 
00009 
00010 Copyright   :   Copyright 2012 Oculus VR, Inc. All Rights reserved.
00011 
00012 Use of this software is subject to the terms of the Oculus license
00013 agreement provided at the time of installation or download, or which
00014 otherwise accompanies this software in either electronic or hard copy form.
00015 
00016 ************************************************************************************/
00017 
00018 #ifndef OVR_System_h
00019 #define OVR_System_h
00020 
00021 #include "OVR_Allocator.h"
00022 #include "OVR_Log.h"
00023 
00024 namespace OVR {
00025 
00026 // ***** System Core Initialization class
00027 
00028 // System initialization must take place before any other OVR_Kernel objects are used;
00029 // this is done my calling System::Init(). Among other things, this is necessary to
00030 // initialize the memory allocator. Similarly, System::Destroy must be
00031 // called before program exist for proper cleanup. Both of these tasks can be achieved by
00032 // simply creating System object first, allowing its constructor/destructor do the work.
00033 
00034 // TBD: Require additional System class for Oculus Rift API?
00035 
00036 class System
00037 {
00038 public:
00039 
00040     // System constructor expects allocator to be specified, if it is being substituted.
00041     System(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
00042            Allocator* palloc = DefaultAllocator::InitSystemSingleton())
00043     {
00044         Init(log, palloc);
00045     }
00046 
00047     ~System()
00048     {
00049         Destroy();
00050     }
00051 
00052     // Returns 'true' if system was properly initialized.
00053     static bool OVR_CDECL IsInitialized();
00054 
00055     // Initializes System core.  Users can override memory implementation by passing
00056     // a different Allocator here.
00057     static void OVR_CDECL Init(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
00058                                Allocator *palloc = DefaultAllocator::InitSystemSingleton());
00059 
00060     // De-initializes System more, finalizing the threading system and destroying
00061     // the global memory allocator.
00062     static void OVR_CDECL Destroy();    
00063 };
00064 
00065 } // OVR
00066 
00067 #endif


oculus_sdk
Author(s):
autogenerated on Fri Aug 28 2015 11:53:11