source: osgVisual/include/extLink/dataIO_extLink.h @ 93

Last change on this file since 93 was 88, checked in by Torben Dannhauer, 14 years ago

Moved memory leak detection from source file to headerfile. Its still in the class but at least not in the source file.

The leak detection works, but the false positives are not stopped.
Use Linux/Valgrind? to make your final leak detection beyond the easy first approach in MSVC

File size: 2.5 KB
Line 
1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 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
23namespace osgVisual
24{ 
25
26/**
27 * \brief This class is the interface definition class for valid externalLink (extLink) implementations.
28 *
29 * This class is an abstract class, thus cannot be instantiated. Derive this class for usage.
30 *
31 * @author Torben Dannhauer
32 * @date  Sep 2009
33 */ 
34
35class dataIO_extLink : public osg::Referenced
36{
37        #include <leakDetection.h>
38public:
39        /**
40         * \brief Empty constructor
41         *
42         */ 
43        dataIO_extLink(std::vector<osgVisual::dataIO_slot>& dataSlots_) : dataSlots(dataSlots_){}
44
45        /**
46         * \brief Empty destructor
47         *
48         * @return
49         */ 
50        virtual ~dataIO_extLink() {}
51
52        /**
53         * \brief Pure virtual function for initialization. Must be implemented in derived class.
54         *
55         */ 
56        virtual void init() = 0;
57
58        virtual void shutdown() = 0;
59
60        /**
61         * \brief Pure virtual function for reading TO_OBJ values form the external link. Must be implemented in derived class.
62         *
63         * @return : See derived class.
64         */ 
65        virtual bool readTO_OBJvalues() = 0;
66
67        /**
68         * \brief Pure virtual function for writing return values back to the external link. Must be implemented in derived class.
69         *
70         * @return : See derived class.
71         */ 
72        virtual bool writebackFROM_OBJvalues() = 0;
73
74protected:
75        /**
76         * Nested external link for more then one external source.
77         */ 
78        osg::ref_ptr<dataIO_extLink> extLink;
79
80        /**
81         * Flag to indicate if this class is initialized.
82         */ 
83        bool initialized;
84
85        /**
86         * Reference to dataIO's central managed dataSlots.
87         * This central dataSlot array is filled with available slots by this extLink class.
88         */ 
89        std::vector<dataIO_slot>& dataSlots;
90 
91};
92
93}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.