source: osgVisual/include/dataIO/dataIO_transportContainer.h @ 169

Last change on this file since 169 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.6 KB
RevLine 
[32]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/Object>
19#include <osg/Matrixd>
[73]20#include <osg/Vec3d>
[32]21
22#include <dataIO_executer.h>
23#include <dataIO_slot.h>
24
25#include <vector>
26
27namespace osgVisual {
28
29class dataIO_transportContainer : public osg::Object
30{
[88]31        #include <leakDetection.h>
[32]32public:
33        META_Object(osgVisual,dataIO_transportContainer);       // Required for serializer
34        dataIO_transportContainer(const osgVisual::dataIO_transportContainer& tC_, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):        // Required for serializer
35                        Object(tC_,copyop),
36                        frameID(tC_.frameID),
37                        viewMatrix(tC_.viewMatrix),
38                        executer(tC_.executer),
39                        ioSlots(tC_.ioSlots){}
40        dataIO_transportContainer(){}
41        virtual ~dataIO_transportContainer(){}
42
43
44        typedef std::vector<osg::ref_ptr<dataIO_executer> > executerList;
45        typedef std::vector<osg::ref_ptr<dataIO_slot> > slotList;
46
47private:
48        int frameID;
49        osg::Matrixd viewMatrix;
50        executerList executer;
51        slotList ioSlots;
52
53// Access functions for Serializer
54public:
55        int getFrameID() const {return frameID;}
56        void setFrameID(int frameID_ ){frameID=frameID_;}
57
[73]58        void setViewMatrix(const osg::Matrixd& viewMatrix_){viewMatrix = viewMatrix_;}
[32]59        const osg::Matrixd& getViewMatrix() const {return viewMatrix;}
60
61        void setExecuter(const executerList& executer_) {executer=executer_;}
62        const executerList& getExecuter() const {return executer;}
63
64        void setIOSlots(const slotList& ioSlots_) {ioSlots=ioSlots_;}
65        const slotList& getIOSlots() const {return ioSlots;}
66
67
68        // Usage functions
69        void addExecuter( osg::ref_ptr<dataIO_executer> executerToAdd_ ) {executer.push_back(executerToAdd_);}
70        void removeAllExecuter() { executer.clear();}
71
72        void addSlot( osg::ref_ptr<dataIO_slot> slotToAdd_ ) {ioSlots.push_back(slotToAdd_);}
73        void removeAllSlots() {ioSlots.clear();}
74
75};
76
77} // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.