VR-Exchange 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pFruit.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2016 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <portal/pObject.h>
14 #include <vlutil/vlString.h>
15 
19 {
20 public:
21 
22  // \brief CTOR.
23  DtPortalFruit();
24 
25  // \brief Virtual DTOR.
26  virtual ~DtPortalFruit();
27 
28  // \brief Copy CTOR.
29  DtPortalFruit( const DtPortalFruit& other );
30 
31  // \brief Assignment operator.
32  DtPortalFruit& operator = ( const DtPortalFruit& other );
33 
36 
37  bool operator == ( const DtPortalFruit& other ) const;
38  bool operator != ( const DtPortalFruit& other ) const;
39 
41 
44 
45  // \brief A string description of the fruit
46  DtDEC_ATTRIBUTE( DtString, FruitType, FruitType );
47 
48  // \brief The location of the fruit, in geocentric coordinates.
49  DtDEC_ATTRIBUTE( DtVector, Location, location );
50 
51  // \brief The sugar content as a percentage of the fruits total volume: in the range 0->100
52  DtDEC_ATTRIBUTE( DtU32, SugarContent, sugarContent );
53 
55 
57 public:
58 
62 
64  static DtPortalMessage* create();
65 
67  virtual unsigned int netSize() const;
68 
70  virtual void writeSelfToBuffer( void* buffer, int bufferSize ) const ;
71 
73  virtual void readSelfFromBuffer( const void* buffer, int bufferSize );
74 
76  virtual std::ostream& printDataToStream( std::ostream& str ) const;
77 
78 };
79 
80 
82 {
83  return new DtPortalFruit();
84 }
85 
86 
87 // \brief Make a reflected object class.
89 
90 // \brief Make a reflected object manager class.
Manages collections of ReflectedObjects of Type T_ReflectedObject.
Definition: pReflectedObjectManager.h:38
MAKVrExchange::DtPortalReflectedObjectManager< DtPortalReflectedFruit > DtPortalReflectedFruitManager
Definition: pFruit.h:91
virtual ~DtPortalFruit()
DtPortalObject are messages which also serve as state repositories for simulated objects.
Definition: pObject.h:23
The base class for all messages passed through the portal.
Definition: pMessage.h:65
bool operator!=(const DtPortalFruit &other) const
bool operator==(const DtPortalFruit &other) const
Contains the DtPortalReflectedObjectManager class declaration.
virtual void readSelfFromBuffer(const void *buffer, int bufferSize)
Decodes class from network structure.
static DtPortalMessage * create()
Creation method - instantiates a new DtPortalFruit.
Definition: pFruit.h:81
static const MAKVrExchange::DtPortalMessageKind theKind
NOTE: DtDEC_ATTRIBUTE resets the access specifier to protected.
Definition: pFruit.h:61
A template to create reflected object types for each type of object message.
Definition: pReflectedObject.h:58
virtual void writeSelfToBuffer(void *buffer, int bufferSize) const
Encodes class to network structure.
virtual std::ostream & printDataToStream(std::ostream &str) const
Prints attributes to a stream.
This class represents Fruit objects.
Definition: pFruit.h:18
virtual unsigned int netSize() const
Returns the number of bytes required to encode this class.
DtPortalMessageKind
A List of message kinds distributed with the Portal.
Definition: pMessageKinds.h:23
Contains the DtPortalObject class declaration.
DtPortalFruit & operator=(const DtPortalFruit &other)
DtPortalMessage(DtPortalMessageKind kind)
CTOR.
DtDEC_ATTRIBUTE(DtString, FruitType, FruitType)
MAKVrExchange::DtPortalReflectedObjectTemplate< DtPortalFruit > DtPortalReflectedFruit
Definition: pFruit.h:88

Document ID: Generated on Mon Apr 19 15:55:22 EDT 2021 from SVN revision 227909
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)