source: osgVisual/include/dataIO/dataIO_slot.h @ 143

Last change on this file since 143 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 <osgDB/ObjectWrapper>
20#include <osgDB/InputStream>
21#include <osgDB/OutputStream>
22
23#include <string>
24
25
26namespace osgVisual {
27
28class dataIO_slot : public osg::Object
29{
[88]30        #include <leakDetection.h>
[32]31public:
32        META_Object(osgVisual,dataIO_slot);
33        dataIO_slot(const osgVisual::dataIO_slot& slot_, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
34            Object(slot_,copyop),
35                        direction(slot_.direction),
36                        variableType(slot_.variableType),
37                        variableName(slot_.variableName),
38                        value(slot_.value),
39                        sValue(slot_.sValue){}
40
41        dataIO_slot(){};
42        ~dataIO_slot(){};
43
44        dataIO_slot & operator=(const dataIO_slot &rhs)
45        {
46                direction=rhs.direction;
47                variableType=rhs.variableType;
48                variableName=rhs.variableName;
49                value=rhs.value;
50                sValue=rhs.sValue;     
51
52                return *this;
53        }
54
55
56        /**
57         * This enums defines the data flow direction of a slot.
58         */ 
59        enum dataDirection {TO_OBJ, FROM_OBJ};
60
61        /**
62         * This enum defines the two valid valuetypes.
63         */ 
64        enum varType {DOUBLE, STRING};
65
66        dataDirection direction;
67        varType variableType;
68        std::string variableName;
69        double value;
70        std::string sValue;
71
72
73// Access functions for Serializer
74        void setdataDirection(dataDirection direction_){direction=direction_;}
75        dataDirection getdataDirection() const {return direction;}
76
77        void setvarType(varType variableType_){variableType=variableType_;}
78        varType getvarType() const {return variableType;}
79
80        const std::string& getVariableName() const {return variableName;}
81        void setVariableName(const std::string& variableName_){variableName=variableName_;}
82
83        double getValue() const {return value;}
84        void setValue(double value_){value=value_;}
85
86        const std::string& getSValue() const {return sValue;}
87        void setSValue(const std::string& sValue_){sValue=sValue_;}
88};
89
90}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.