VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
weaponListResponseAdmin.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include "vrftasks/adminContent.h"
14 #include <list>
15 
18 {
25 };
26 
28 {
32  std::list<DtSimTaskMessageType> myFireTaskTypes;
33  std::list<DtEntityType> myDesiredAmmunition;
34  bool operator==(const WeaponSystem& rhs) const
35  {
36  return ((myWeaponId == rhs.myWeaponId) &&
37  (myWeaponName == rhs.myWeaponName) &&
38  (myWeaponType == rhs.myWeaponType) &&
41  }
42 
43  bool operator!=(const WeaponSystem& rhs) const
44  {
45  return !(*this == rhs);
46  }
47 };
48 
49 DT_DLL_vrftasks int getSize(const WeaponSystem& data);
50 DT_DLL_vrftasks char* encode(const WeaponSystem& data, char* buffer);
51 DT_DLL_vrftasks const char* decode(WeaponSystem& data, const char* buffer);
52 
53 typedef std::list<WeaponSystem> DtWeaponList;
54 
58 {
59 public:
60 
63 
66 
70 
72  virtual ~DtWeaponListResponseAdmin() override;
73 
75  static DtAdminContent* create();
76 
78  virtual bool init() override;
79 
81  virtual const DtAdminContentMessageType& type() const override;
82 
84 
85  virtual const DtWeaponList& weaponSystems() const;
86  virtual DtWeaponList& weaponSystems();
88 
91  virtual void addWeaponSystem(const WeaponSystem& weap);
92  virtual void addWeaponSystem(const DtString& modeName,DtWeaponSystemType systemType, const std::list<DtEntityType>& desiredAmmunition);
93 
95  virtual void clearWeaponSystems();
96 
99  virtual DtAdminContent* clone() const override;
100 
102  virtual DtString stringRep() const override;
103 
105  virtual int netRepSize() const override;
106 
108  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
109 
111  virtual bool setToNet() override;
112 
113 protected:
116 };
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets the contents of this set request based on the network buffer. Base class does nothing and return...
bool operator!=(const WeaponSystem &rhs) const
Definition: weaponListResponseAdmin.h:43
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
Definition: weaponListResponseAdmin.h:22
Admin content which contains the list of weapon systems on an entity. This is the response to the DtR...
Definition: weaponListResponseAdmin.h:57
virtual int netRepSize() const
bool operator==(const WeaponSystem &rhs) const
Definition: weaponListResponseAdmin.h:34
Definition: weaponListResponseAdmin.h:23
virtual DtAdminContent * clone() const =0
Make a copy of this content. Returns a pointer to a newly created copy of this class. Derived classes must override this function to create and return an instance of the derived type.
DtString myWeaponName
Definition: weaponListResponseAdmin.h:30
Definition: vrfObjectMessageTypeTemplate.h:24
std::list< DtEntityType > myDesiredAmmunition
Definition: weaponListResponseAdmin.h:33
DtWeaponSystemType
This now allows us to query the backend for specific types of weapons.
Definition: weaponListResponseAdmin.h:17
const DtAdminContent & operator=(const DtAdminContent &orig)
assignment operator; same as copy costructor.
Definition: weaponListResponseAdmin.h:20
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
Definition: weaponListResponseAdmin.h:21
std::list< DtSimTaskMessageType > myFireTaskTypes
Definition: weaponListResponseAdmin.h:32
#define DT_DLL_vrftasks
This file is used to determine how to build.
Definition: vrftasksDefines.h:26
std::list< WeaponSystem > DtWeaponList
Definition: weaponListResponseAdmin.h:53
virtual bool init()
Base class init does nothing, but this will be called by create, in case any other deriving class nee...
DtAdminContent.
Definition: adminContent.h:23
virtual const DtAdminContentMessageType & type() const =0
DtString myWeaponId
Definition: weaponListResponseAdmin.h:29
Definition: weaponListResponseAdmin.h:24
DtWeaponList myWeaponSystems
The list of weapon system names.
Definition: weaponListResponseAdmin.h:115
Definition: weaponListResponseAdmin.h:27
virtual bool setToNet()
Sets netRep buffer to the contents of this set request. Base class does nothing and returns true...
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
virtual DtString stringRep() const =0
Get a readable string representation of this content. Derived classes must implement this function...
DtWeaponSystemType myWeaponType
Definition: weaponListResponseAdmin.h:31
Definition: weaponListResponseAdmin.h:19

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)