MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
property.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 2012 MaK Technologies, Inc.
3  ** All rights reserved.
4  *********************************************************************/
5 
6 
7 #ifndef property_H_
8 #define property_H_
9 
10 #include <QtCore/QVariant>
11 #include <QtCore/QString>
12 #include <list>
13 
14 #include <rtiMsConfig.h>
15 #include "propertyType.h"
16 #include <memory>
17 
18 class DtProperty;
20 typedef std::auto_ptr<DtPropertyType> DtPropertyTypeAP;
21 typedef std::list<DtProperty> DtPropertyList;
22 
25 {
26 public:
27 
28  // Default constructor Construct a property of a name and type.
29  DtProperty(QString name, DtPropertyTypeAP type,QVariant value);
30 
32  DtProperty(const DtProperty&);
33 
34  // Default constructor, used by list, do NOT USE. Internal values are
35  // invalid.
36  DtProperty();
37 
38  // DTOR
39  ~DtProperty();
40 
41  //bool operator== (const DtProperty&);
42  DtProperty& operator= (const DtProperty&);
43  virtual bool operator<(const DtProperty&) const;
44 
45  DtProperty& appendChild(const DtProperty& child);
46  void removeChild(QString name);
47 
49  DtProperty* findChild(QString name);
50  const DtProperty* findChild(QString name) const;
51 
52  // Accessors
53  const DtPropertyType* type() const;
54  QString name() const;
55  QVariant value() const;
56 
57  // This provides a simple means of identifying a property and provides a hook
58  // to associate this property with some other object. Helps alleviate problems
59  // of objects with duplicate names. Id of -1 is defualt--ie it's unassigned.
60  int id() const;
61 
62  // Is read only if myReadOnly is true OR parent is readOnly.
63  // If no parent then use only myReadOnly.
64  bool readOnly() const;
65 
66  DtPropertyList* children();
67  const DtPropertyList* children() const;
68 
69  // Mutators
70  void setId(int id);
71  void setValue(QVariant value);
72  void setReadOnly(bool readOnly);
73 
74 protected:
75  QString myName;
76  QVariant myValue;
78  int myId;
81  bool myReadOnly;
82 };
83 
84 #endif

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)