VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
exampleEmbeddedSystemRepository.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #pragma once
7 
8 #include <vl/embeddedSystemRepository.h>
9 
10 
11 // This class extends the base embedded system repository to add custom
12 // attributes specific to our example embedded system implementation.
13 // It serves as the data container for network communication and state
14 // management of embedded system properties.
15 //
16 // The repository pattern is used throughout the VRF framework to:
17 // - Encapsulate state data in a standardized way
18 // - Provide consistent access methods
19 // - Enable serialization for network communication
20 // - Support state comparison and change detection
21 //
22 // This specific implementation adds:
23 // - System ID: Unique identifier for the embedded system instance
24 // - Model Number: Type/model identifier for the embedded system hardware/software
26 {
27 public:
30 
33 
36 
39 
40  // This method is used by the framework for creating repository instances
41  // during network communication and state management operations.
42  //
43  // @param copy If true, copies the current state; if false, creates empty instance
44  // @return Pointer to new repository instance (caller owns the memory)
45  //
46  virtual DtStateRepository* clone(bool copy = false) const;
47 
48  //
49  // @brief Factory method for creating new repository instances.
50  // @return Pointer to new repository instance (caller owns the memory)
51  //
53 
56 
57  // @brief Sets the unique system identifier.
58  // @param id Unique identifier for this embedded system instance
59  virtual void setSystemId(unsigned id);
60 
61  // @brief Gets the unique system identifier.
62  // @return Current system ID value
63  virtual unsigned systemId() const;
64 
66 
69 
70  //@brief Sets the model/type number for this embedded system.
71  //@param number Model identifier indicating the type of embedded system
72  virtual void setModelNumber(unsigned number);
73 
74  // @brief Gets the model/type number for this embedded system.
75  // @return Current model number value
76  virtual unsigned modelNumber() const;
77 
79 
82 
83 
84  // @brief Prints the repository data to the standard debug output stream.
85  // Used for debugging and development purposes.
86  virtual void printData() const;
87 
88 
89  // @brief Prints the repository data to a specified output stream.
90  // @param stream Output stream to write the data to
91  virtual void printDataToStream(std::ostream& stream) const;
92 
94 
95 protected:
97  unsigned mySystemId;
98 
100  unsigned myModelNumber;
101 };
102 
unsigned mySystemId
Unique identifier for this embedded system instance within the host entity.
Definition: exampleEmbeddedSystemRepository.h:97
unsigned myModelNumber
Model/type identifier that categorizes this embedded system&#39;s capabilities.
Definition: exampleEmbeddedSystemRepository.h:100
Definition: exampleEmbeddedSystemRepository.h:25
virtual void printData() const
virtual void printDataToStream(std::ostream &stream) const
virtual void setSystemId(unsigned id)
virtual DtStateRepository * clone(bool copy=false) const
static DtExampleEmbeddedSystemRepository * create()
virtual unsigned systemId() const
virtual unsigned modelNumber() const
voidpf stream
Definition: ioapi.h:39
virtual ~DtExampleEmbeddedSystemRepository()
Virtual destructor for proper cleanup of derived classes.
DtExampleEmbeddedSystemRepository()
Default constructor - initializes all fields to default values.
virtual void setModelNumber(unsigned number)
DtExampleEmbeddedSystemRepository & operator=(const DtExampleEmbeddedSystemRepository &orig)
Assignment operator - performs deep copy assignment.

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)