VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwNameReservationConfig.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2025 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfutil/vrfutilDefines.h"
12 
14 #include <readerWriter/rwBoolean.h>
15 #include <readerWriter/rwInt.h>
16 #include <readerWriter/rwString.h>
17 
18 #include <vrfutil/rwStringList.h>
20 #include <vrfutil/rwEntityType.h>
22 
24 
26 
28 {
29 public:
32  DtRwObjectNameReservationConfig(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
33  DtRwObjectNameReservationConfig(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
34 
37 
40 
42  DtString objectType() const { return myObjectType; }
44  void setObjectType(DtString val) { myObjectType = val; }
45 
47  const DtRwEntityTypeList& matchingTypes() const { return myMatchingTypes; }
49  void addMatchingType(DtEntityType val)
50  {
51  myMatchingTypes.addEntityType(val);
52  myMatchingTypes.setValueSpecified(true);
53  }
55  void removeMatchingType(DtEntityType val)
56  {
57  myMatchingTypes.removeEntityType(val);
58  myMatchingTypes.setValueSpecified(true);
59  }
60 
62  DtString nameFormat() const { return myNameFormat; }
64  void setNameFormat(DtString val) { myNameFormat = val; }
65 
69  unsigned startingId() const { return myStartingId; }
71  void setStartingId(unsigned val) { myStartingId = val; }
72 
74  int numberToReserve() const { return myNumberToReserve; }
76  void setNumberToReserve(int val) { myNumberToReserve = val; }
77 
79  int numberRemainingBeforeReservingMore() const { return myNumberRemainingBeforeReservingMore; }
81  void setNumberRemainingBeforeReservingMore(int val) { myNumberRemainingBeforeReservingMore = val; }
82 
84  const DtRwStringList& subObjectReservations() const { return mySubObjectReservations; }
86  void setSubObjectReservations(DtRwStringList val) { mySubObjectReservations = val; }
87 
88 protected:
96 };
97 
99 {
100 public:
101 
104 
107 
110 
112  {
113  return myObjectNameReservations;
114  }
115 
117  {
118  return myObjectNameReservations;
119  }
120 
121 protected:
123 };
124 
125 bool DT_DLL_vrfutil ReadFromFile(const DtFilename& filePath, DtRwNameReservationConfig* input,
127 bool DT_DLL_vrfutil WriteToFile(const DtFilename& filePath, DtRwNameReservationConfig* input);
const DtRwObjectNameReservationConfigList & objectNameReservations() const
Definition: rwNameReservationConfig.h:116
int numberToReserve() const
Returns the number of names to pre-reserve for this object type.
Definition: rwNameReservationConfig.h:74
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
DtRwString myNameFormat
Definition: rwNameReservationConfig.h:91
bool DT_DLL_vrfutil WriteToFile(const DtFilename &filePath, DtRwChatChannelConfig *input)
bool DT_DLL_vrfutil ReadFromFile(const DtFilename &filePath, DtRwChatChannelConfig *input, const DtVariableBindingsList &variableBindings=DtReaderWriter::nullVariableReference())
void setStartingId(unsigned val)
Sets the starting number to use for IDs in the name format string.
Definition: rwNameReservationConfig.h:71
int numberRemainingBeforeReservingMore() const
Returns the threshold of remaining reserved names that triggers reserving more.
Definition: rwNameReservationConfig.h:79
void setNumberRemainingBeforeReservingMore(int val)
Sets the threshold of remaining reserved names that triggers reserving more.
Definition: rwNameReservationConfig.h:81
class DtRwEntityTypeList:
Definition: rwEntityTypeList.h:23
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
const DtRwStringList & subObjectReservations() const
Returns the list of sub-object type identifiers whose names should be reserved alongside this object...
Definition: rwNameReservationConfig.h:84
DtRwObjectNameReservationConfigList myObjectNameReservations
Definition: rwNameReservationConfig.h:122
Definition: rwNameReservationConfig.h:98
void setObjectType(DtString val)
Sets the object type identifier string.
Definition: rwNameReservationConfig.h:44
void setNameFormat(DtString val)
Sets the name format string used to generate object names.
Definition: rwNameReservationConfig.h:64
void setNumberToReserve(int val)
Sets the number of names to pre-reserve for this object type.
Definition: rwNameReservationConfig.h:76
DtRwStringList mySubObjectReservations
Definition: rwNameReservationConfig.h:95
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
Description: Readable, Writable int.
Definition: rwInt.h:25
unsigned startingId() const
Optionally, the starting number to use for IDs in the name format string. If not specified, the name generator will start with 1. The starting ID is ignored for sim-objects, which always start with 1.
Definition: rwNameReservationConfig.h:69
void setSubObjectReservations(DtRwStringList val)
Sets the list of sub-object type identifiers whose names should be reserved alongside this object...
Definition: rwNameReservationConfig.h:86
DtRwInt myNumberRemainingBeforeReservingMore
Definition: rwNameReservationConfig.h:94
DtRwString myObjectType
Definition: rwNameReservationConfig.h:89
DtRwEntityTypeList myMatchingTypes
Definition: rwNameReservationConfig.h:90
const DtRwEntityTypeList & matchingTypes() const
Returns the list of entity types that this reservation config applies to.
Definition: rwNameReservationConfig.h:47
static const DtVariableBindingsList & nullVariableReference()
DtString objectType() const
Returns the object type identifier string (e.g. &quot;sim-object&quot;, &quot;emitter-system&quot;).
Definition: rwNameReservationConfig.h:42
DtRwObjectNameReservationConfigList & objectNameReservations()
Definition: rwNameReservationConfig.h:111
Definition: rwNameReservationConfig.h:27
DtString nameFormat() const
Returns the name format string used to generate object names (e.g. &quot;{federateHandle}-{id}&quot;).
Definition: rwNameReservationConfig.h:62
DtRwInt myNumberToReserve
Definition: rwNameReservationConfig.h:93
DtRwInt myStartingId
Definition: rwNameReservationConfig.h:92
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
Definition: rwStringList.h:20
void removeMatchingType(DtEntityType val)
Removes an entity type from the list of matching types for this reservation config.
Definition: rwNameReservationConfig.h:55
void addMatchingType(DtEntityType val)
Adds an entity type to the list of matching types for this reservation config.
Definition: rwNameReservationConfig.h:49

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)