]> git.mxchange.org Git - simgear.git/blob - simgear/hla/RTIObjectClass.hxx
hla: Use raw pointers for HLAFederate::_insert methods.
[simgear.git] / simgear / hla / RTIObjectClass.hxx
1 // Copyright (C) 2009 - 2012  Mathias Froehlich - Mathias.Froehlich@web.de
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Library General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 //
17
18 #ifndef RTIObjectClass_hxx
19 #define RTIObjectClass_hxx
20
21 #include <string>
22 #include "simgear/structure/SGReferenced.hxx"
23 #include "RTIData.hxx"
24 #include "HLAObjectClass.hxx"
25
26 namespace simgear {
27
28 class RTIData;
29 class RTIObjectInstance;
30 class HLAObjectClass;
31
32 class RTIObjectClass : public SGReferenced {
33 public:
34     RTIObjectClass(HLAObjectClass* objectClass);
35     virtual ~RTIObjectClass();
36
37     virtual bool resolveAttributeIndex(const std::string& name, unsigned index) = 0;
38
39     virtual unsigned getNumAttributes() const = 0;
40
41     virtual bool publish(const HLAIndexList& indexList) = 0;
42     virtual bool unpublish() = 0;
43
44     virtual bool subscribe(const HLAIndexList& indexList, bool) = 0;
45     virtual bool unsubscribe() = 0;
46
47     // Factory to create an object instance that can be used in this current federate
48     virtual RTIObjectInstance* registerObjectInstance(HLAObjectInstance*) = 0;
49
50     // Call back into HLAObjectClass
51     void discoverInstance(RTIObjectInstance* objectInstance, const RTIData& tag) const;
52
53     void startRegistration() const;
54     void stopRegistration() const;
55
56 private:
57     HLAObjectClass* _objectClass;
58
59     friend class HLAObjectClass;
60 };
61
62 }
63
64 #endif