VR-Forces 4.0.4 Class Documentation
examples/settingsManager/settingsManagerSim/myObjectManager.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2009 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: myObjectManager.h,v $ $Revision: 1.2 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef MyObjectManager_H_
00010 #define MyObjectManager_H_
00011 
00012 #include "vrfobjcore/vrfObjMgr.h"
00013 #include "mySettingsManager.h"
00014 
00015 class DtTestSettings;
00016 
00017 class MyObjectManager : public DtVrfObjectManager
00018 {
00019 public:
00020 
00021    //The constructor takes a DtSimManager and entityAdvisory which get passed 
00022    //to the base class
00023    MyObjectManager(DtSimManager* simManager, int entityAdvisory);
00024 
00025    //destructor
00026    virtual ~MyObjectManager();
00027 
00028    //Adds to the existing settings file as well as creating a new one
00029    virtual bool init();
00030 
00031    //Callback registered as a consumer for the test setting. This will be
00032    //called when settingsManagerRemote changes the setting.
00033    static void testSettingsChangedCallback(
00034       const DtSettingsObject* settings, void* usr);
00035    //Stores the values from the settings in myDoubleValue and myBoolValue
00036    virtual void processTestSettingsChanged(const DtTestSettings* settings);
00037 
00038    //Callback registered as a producer for the test setting. This will be
00039    //called any time the settings manager looks up the setting, including
00040    //when the settings file is written out.
00041    static void updateTestSettingsCallback(
00042       DtSettingsObject* settings, void* usr);
00043    //Copies myDoubleValue and myBoolValue into the setting object
00044    virtual void processUpdateTestSettings(DtTestSettings* settings);
00045    
00046 public:
00047 
00048    //Creator function to be registered with the DtDefaultVrfCreator from
00049    //main.cxx
00050    static DtVrfObjectManager* creator(DtSimManager* simManager, 
00051       int entityAdvisory);
00052 
00053 public:
00054    //Settings manager for the new settings file
00055    MySettingsManager* mySettingsManager;
00056 
00057    //Example data which needs to be saved out to the settings files. This
00058    //class is the "owner" of this data, the settings manager only asks for
00059    //it when it needs to write out the settings file by calling
00060    //updateTestSettingsCallback.
00061    double myDoubleValue;
00062    bool myBoolValue;
00063 };
00064 
00065 #endif
00066 
00067 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)