/****************************************************************************
 * Copyright (c) 1992-2026 MAK Technologies, Inc
 * All rights reserved.
 ****************************************************************************/

#pragma once

//! \file utility.h
//! \ingroup managedInterface
//! \brief Defines commonly used names of resources and ways to access those resources.

/*
 * This file acts like a DAO (Data Access Object) or a simple database of resources used
 * by an application, such as entities, reflected lists, publishers, etc. Rather than 
 * expose global variables directly, service functions are used to reduce coupling 
 * between definition and use of the resources and services.
 */

#include "managedInterface/plugin.h"
#include "matrix/vlVector.h"

#include <string>
#include <list>

class DtExerciseConn;
class DtClock;
class DtReflectedEntity;
class DtReflectedEntityList;
class DtEntityPublisher;
class DtReflectedEmitterSystem;
class DtReflectedEmitterSystemList;
class DtEmitterSystemPublisher;
class DtTaitBryan;

#ifdef DtHLA
// Some services are only applicable for HLA, such as emitter beams.
class DtReflectedEmitterBeam;
class DtReflectedEmitterBeamList;
class DtEmitterBeamPublisher;
#endif

//! \brief names for commonly found things
//{@
MANAGEDINTERFACE_DLL extern const char* EXERCISE_CONNECTION_NAME;
MANAGEDINTERFACE_DLL extern const char* CLOCK_NAME;
MANAGEDINTERFACE_DLL extern const char* REFLECTED_ENTITY_LIST_NAME;
MANAGEDINTERFACE_DLL extern const char* ENTITY_PUBLISHER_LIST_NAME;
MANAGEDINTERFACE_DLL extern const char* RECEIVER_PUBLISHER_LIST;
MANAGEDINTERFACE_DLL extern const char* REFLECTED_RECEIVER_LIST;
MANAGEDINTERFACE_DLL extern const char* REFLECTED_TRANSMITTER_LIST;
MANAGEDINTERFACE_DLL extern const char* TRANSMITTER_PUBLISHER_LIST;
//@}

//! \brief find and set commonly used objects
//{@
MANAGEDINTERFACE_DLL DtExerciseConn* findExConnResource();
MANAGEDINTERFACE_DLL void setExConnResource(DtExerciseConn* conn);

//! \brief entities use their global ID as a their name in the resource map
MANAGEDINTERFACE_DLL DtReflectedEntity* findReflectedEntityResource(std::string id);
MANAGEDINTERFACE_DLL void setReflectedEntityResource(std::string id, DtReflectedEntity* ent);

//! \brief entities use their global ID as a their name in the resource map
MANAGEDINTERFACE_DLL DtEntityPublisher* findEntityPublisherResource(std::string id);
MANAGEDINTERFACE_DLL void setEntityPublisherResource(std::string id, DtEntityPublisher* pub);

MANAGEDINTERFACE_DLL DtClock* findClockResource();
MANAGEDINTERFACE_DLL void setClockResource(DtClock* clock);

MANAGEDINTERFACE_DLL DtReflectedEntityList* findReflectedEntityListResource();
MANAGEDINTERFACE_DLL void setReflectedEntityListResource(DtReflectedEntityList* rel);

//@}
