VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
noDataAdminContent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include "vrftasks/adminContent.h"
14 
15 
21 template <typename T_functor>
23 {
24 public:
27 
30  : DtAdminContent(orig)
31  { }
32 
35  DtNoDataAdminContent & orig)
36  {
37  if (this != &orig)
38  {
40  }
41  return *this;
42  }
43 
45  virtual ~DtNoDataAdminContent() override { }
46 
49  {
51  }
52 
54  virtual bool init() override
55  {
56  if (!DtAdminContent::init())
57  {
58  return false;
59  }
60  return true;
61  }
62 
64  virtual const DtAdminContentMessageType& type() const override {
65  return T_functor()();
66  }
67 
70  virtual DtAdminContent* clone() const override {
71  return new DtNoDataAdminContent<T_functor>(*this);
72  }
73 
77  virtual DtString stringRep() const override
78  {
79  DtString str = "Admin Content type ";
80  str += type();
81  str += ". No text available.";
82  return str;
83  }
84 
86  virtual int netRepSize() const override
87  {
89  return size;
90  }
91 
93  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override
94  {
95  DtAdminContent::setFromNet(contentBuffer, contentSize);
96  contentBuffer += DtAdminContent::netRepSize();
97  return true;
98  }
99 
101  virtual bool setToNet() override
102  {
104  return true;
105  }
106 };
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...
virtual int netRepSize() const
virtual ~DtNoDataAdminContent() override
destructor
Definition: noDataAdminContent.h:45
voidpf void uLong size
Definition: ioapi.h:39
virtual const DtAdminContentMessageType & type() const override
Definition: noDataAdminContent.h:64
Definition: vrfObjectMessageTypeTemplate.h:24
const DtNoDataAdminContent & operator=(const DtNoDataAdminContent &orig)
assignment operator; same as copy costructor.
Definition: noDataAdminContent.h:34
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Decodes content from buffer.
Definition: noDataAdminContent.h:93
const DtAdminContent & operator=(const DtAdminContent &orig)
assignment operator; same as copy costructor.
Class for DtAdminContent subclasses that contain no data.
Definition: noDataAdminContent.h:22
virtual DtString stringRep() const override
Get a readable string representation of this content.
Definition: noDataAdminContent.h:77
DtNoDataAdminContent(const DtNoDataAdminContent &orig)
copy constructor
Definition: noDataAdminContent.h:29
virtual int netRepSize() const override
Definition: noDataAdminContent.h:86
static DtAdminContent * create()
Creator function. Returns new instance of this class.
Definition: noDataAdminContent.h:48
virtual bool init()
Base class init does nothing, but this will be called by create, in case any other deriving class nee...
virtual bool init() override
Call after construction.
Definition: noDataAdminContent.h:54
DtAdminContent.
Definition: adminContent.h:23
virtual bool setToNet()
Sets netRep buffer to the contents of this set request. Base class does nothing and returns true...
virtual bool setToNet() override
Encodes content into buffer.
Definition: noDataAdminContent.h:101
DtNoDataAdminContent()
default constructor
Definition: noDataAdminContent.h:26
virtual DtAdminContent * clone() const override
Make a copy of this content. Returns a pointer to a newly created copy of this class.
Definition: noDataAdminContent.h:70

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)