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<DtString> myResources;
34  bool operator==(const WeaponSystem& rhs) const
35  {
36  return ((myWeaponId == rhs.myWeaponId) &&
37  (myWeaponName == rhs.myWeaponName) &&
38  (myWeaponType == rhs.myWeaponType) &&
40  (myResources == rhs.myResources) );
41  }
42 
43  bool operator!=(const WeaponSystem& rhs) const
44  {
45  return !(*this == rhs);
46  }
47  };
48 
49 #ifdef WIN32
50 namespace DtBufferSerialize
51 {
52 #endif
53  DT_DLL_vrftasks int getSize(const WeaponSystem& data);
54  DT_DLL_vrftasks char* encode(const WeaponSystem& data, char* buffer);
55  DT_DLL_vrftasks const char* decode(WeaponSystem& data, const char* buffer);
56 #ifdef WIN32
57 }
58 #endif
59 
60 typedef std::list<WeaponSystem> DtWeaponList;
61 
65 {
66 public:
67 
70 
73 
77 
79  virtual ~DtWeaponListResponseAdmin();
80 
82  static DtAdminContent* create();
83 
85  virtual bool init();
86 
88  virtual const DtAdminContentMessageType& type() const;
89 
91 
92  virtual const DtWeaponList& weaponSystems() const;
93  virtual DtWeaponList& weaponSystems();
95 
98  virtual void addWeaponSystem(const WeaponSystem& weap);
99  virtual void addWeaponSystem(const DtString& modeName,DtWeaponSystemType systemType,std::list<DtString>& resourceList);
100 
102  virtual void clearWeaponSystems();
103 
106  virtual DtAdminContent* clone() const;
107 
109  virtual DtString stringRep() const;
110 
112  virtual int netRepSize() const;
113 
115  virtual bool setFromNet(const char* contentBuffer,
116  unsigned contentSize);
117 
119  virtual bool setToNet();
120 
121 protected:
124 };
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:64
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
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
std::list< DtString > myResources
Definition: weaponListResponseAdmin.h:33
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:60
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:123
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)