VR-Forces 4.10 Class Documentation
 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() { }
46 
49  {
51  }
52 
54  virtual bool init()
55  {
56  if (!DtAdminContent::init())
57  {
58  return false;
59  }
60  return true;
61  }
62 
64  virtual const DtAdminContentMessageType& type() const
65  {
66  return T_functor()();
67  }
68 
71  virtual DtAdminContent* clone() const
72  {
73  return new DtNoDataAdminContent<T_functor>(*this);
74  }
75 
79  virtual DtString stringRep() const
80  {
81  DtString str = "Admin Content type ";
82  str += type();
83  str += ". No text available.";
84  return str;
85  }
86 
88  virtual int netRepSize() const
89  {
91  return size;
92  }
93 
95  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize)
96  {
97  DtAdminContent::setFromNet(contentBuffer, contentSize);
98  contentBuffer += DtAdminContent::netRepSize();
99  return true;
100  }
101 
103  virtual bool setToNet()
104  {
106  return true;
107  }
108 };
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets the contents of this set request based on the network buffer.
virtual int netRepSize() const
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Decodes content from buffer.
Definition: noDataAdminContent.h:95
virtual ~DtNoDataAdminContent()
destructor
Definition: noDataAdminContent.h:45
voidpf void uLong size
Definition: ioapi.h:39
virtual const DtAdminContentMessageType & type() const
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 DtString stringRep() const
Get a readable string representation of this content.
Definition: noDataAdminContent.h:79
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 bool init()
Call after construction.
Definition: noDataAdminContent.h:54
DtNoDataAdminContent(const DtNoDataAdminContent &orig)
copy constructor
Definition: noDataAdminContent.h:29
virtual int netRepSize() const
Definition: noDataAdminContent.h:88
virtual bool setToNet()
Encodes content into buffer.
Definition: noDataAdminContent.h:103
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...
DtAdminContent.
Definition: adminContent.h:24
virtual bool setToNet()
Sets netRep buffer to the contents of this set request.
DtNoDataAdminContent()
default constructor
Definition: noDataAdminContent.h:26
virtual DtAdminContent * clone() const
Make a copy of this content.
Definition: noDataAdminContent.h:71

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)