VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Extended Object Manager

This subclass of the DtVrfObjectManager prints out a message in its tick() method


Header file:

/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#pragma once
{
public:
// The constructor takes a DtSimulationServices and entityAdvisory which get passed
// to the base class
// destructor
virtual ~MyObjectManager() override;
// This is a good place to add your own behavior.
virtual void tick() override;
// This is overridden to show how you can show how you can choose your own HLA object
// name (global ID) when creating a new object.
virtual bool add(DtLocalObject* simObject) override;
public:
// Creator function to be registered with the DtDefaultVrfCreator from main.cxx
};

Implementation:

/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include "myObjectManager.h"
//It is important to pass the DtSimulationServices to the constructor of the base class
{
}
{
}
{
DtPROFILE("MyObjectManager::tick");
//This is a good place to add your own functionality. For instance, if you
//were making an after action review tool, this might be a good place to
//connect to a database to store simulation information.
DtInfo("MyObjectManager::tick()\n");
//In order for VR-Forces to function, it is vital to call down to the base
//class !
}
{
// For HLA, this is where we can override the global ID (aka HLA object name) for
// a newly created object.
if (DtString("DIS") !=
{
DtString globalId = "Global_Id_Is_";
globalId += simObject->objectName();
simObject->setGlobalIdentifierForPublication(globalId);
}
return DtLocalObjectManager::add(simObject);
}
//The creator simply calls new. It is important to pass on the DtSimulationServices.
{
return new MyObjectManager(simManager);
}

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)