1 | #pragma once |
---|
2 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer |
---|
3 | * |
---|
4 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
5 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
6 | * (at your option) any later version. The full license is in LICENSE file |
---|
7 | * included with this distribution, and on the openscenegraph.org website. |
---|
8 | * |
---|
9 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
10 | * You have to aquire licenses for all used proprietary modules. |
---|
11 | * |
---|
12 | * This library is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * OpenSceneGraph Public License for more details. |
---|
16 | */ |
---|
17 | |
---|
18 | #include <osg/Referenced> |
---|
19 | #include <osg/Node> |
---|
20 | #include <dataIO_slot.h> |
---|
21 | |
---|
22 | // XML Parser |
---|
23 | #include <stdio.h> |
---|
24 | #include <libxml/parser.h> |
---|
25 | #include <libxml/tree.h> |
---|
26 | |
---|
27 | |
---|
28 | namespace osgVisual |
---|
29 | { |
---|
30 | |
---|
31 | /** |
---|
32 | * \brief This class is the interface definition class for valid externalLink (extLink) implementations. |
---|
33 | * |
---|
34 | * This class is an abstract class, thus cannot be instantiated. Derive this class for usage. |
---|
35 | * |
---|
36 | * @author Torben Dannhauer |
---|
37 | * @date Sep 2009 |
---|
38 | */ |
---|
39 | |
---|
40 | class dataIO_extLink : public osg::Referenced |
---|
41 | { |
---|
42 | #include <leakDetection.h> |
---|
43 | public: |
---|
44 | /** |
---|
45 | * \brief Empty constructor |
---|
46 | * |
---|
47 | */ |
---|
48 | dataIO_extLink(std::vector<osgVisual::dataIO_slot *>& dataSlots_) : dataSlots(dataSlots_){} |
---|
49 | |
---|
50 | /** |
---|
51 | * \brief Empty destructor |
---|
52 | * |
---|
53 | * @return |
---|
54 | */ |
---|
55 | virtual ~dataIO_extLink() {} |
---|
56 | |
---|
57 | /** |
---|
58 | * \brief Pure virtual function for initialization. Must be implemented in derived class. |
---|
59 | * |
---|
60 | */ |
---|
61 | virtual bool init( xmlNode* configurationNode) = 0; |
---|
62 | |
---|
63 | /** |
---|
64 | * \brief Pure virtual function for XML configuration. Must be implemented in derived class. |
---|
65 | * |
---|
66 | */ |
---|
67 | virtual bool processXMLConfiguration(xmlNode* extLinkConfig_) = 0; |
---|
68 | |
---|
69 | /** |
---|
70 | * \brief Pure virtual function for shutdown. Must be implemented in derived class. |
---|
71 | * |
---|
72 | */ |
---|
73 | virtual void shutdown() = 0; |
---|
74 | |
---|
75 | /** |
---|
76 | * \brief Pure virtual function for reading TO_OBJ values form the external link. Must be implemented in derived class. |
---|
77 | * |
---|
78 | * @return : See derived class. |
---|
79 | */ |
---|
80 | virtual bool readTO_OBJvalues() = 0; |
---|
81 | |
---|
82 | /** |
---|
83 | * \brief Pure virtual function for writing return values back to the external link. Must be implemented in derived class. |
---|
84 | * |
---|
85 | * @return : See derived class. |
---|
86 | */ |
---|
87 | virtual bool writebackFROM_OBJvalues() = 0; |
---|
88 | |
---|
89 | protected: |
---|
90 | /** |
---|
91 | * Nested external link for more then one external source. |
---|
92 | */ |
---|
93 | osg::ref_ptr<dataIO_extLink> extLink; |
---|
94 | |
---|
95 | /** |
---|
96 | * Flag to indicate if this class is initialized. |
---|
97 | */ |
---|
98 | bool initialized; |
---|
99 | |
---|
100 | /** |
---|
101 | * Reference to dataIO's central managed dataSlots. |
---|
102 | * This central dataSlot array is filled with available slots by this extLink class. |
---|
103 | */ |
---|
104 | std::vector<dataIO_slot *>& dataSlots; |
---|
105 | |
---|
106 | }; |
---|
107 | |
---|
108 | } // END NAMESPACE |
---|