Added explicit initialization of osg::Referenced(true) to osg::Operation subclasses as it uses virtual inhertiance from osg::Referenced.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15024 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-07-23 15:46:39 +00:00
parent 42efcf24fb
commit 761cf52bb7
16 changed files with 21 additions and 4 deletions

View File

@ -540,6 +540,7 @@ public:
const std::string& outputFilename, const std::string& outputFilename,
SceneGraphProcessor* sceneGraphProcessor, SceneGraphProcessor* sceneGraphProcessor,
osgUtil::IncrementalCompileOperation* ico): osgUtil::IncrementalCompileOperation* ico):
osg::Referenced(true),
Operation("DatabasePaging Operation", false), Operation("DatabasePaging Operation", false),
_filename(filename), _filename(filename),
_outputFilename(outputFilename), _outputFilename(outputFilename),

View File

@ -1366,6 +1366,7 @@ class CompileStateCallback : public osg::Operation
{ {
public: public:
CompileStateCallback(GameEventHandler* eh): CompileStateCallback(GameEventHandler* eh):
osg::Referenced(true),
osg::Operation("CompileStateCallback", false), osg::Operation("CompileStateCallback", false),
_gameEventHandler(eh) {} _gameEventHandler(eh) {}

View File

@ -29,6 +29,7 @@ class CalibrateCostEsimator : public osg::GraphicsOperation
public: public:
CalibrateCostEsimator(osg::GraphicsCostEstimator* gce): CalibrateCostEsimator(osg::GraphicsCostEstimator* gce):
osg::Referenced(true),
osg::GraphicsOperation("CalbirateCostEstimator",false), osg::GraphicsOperation("CalbirateCostEstimator",false),
_gce(gce) {} _gce(gce) {}

View File

@ -26,6 +26,7 @@ class MotionBlurOperation: public osg::Operation
{ {
public: public:
MotionBlurOperation(double persistence): MotionBlurOperation(double persistence):
osg::Referenced(true),
osg::Operation("MotionBlur",true), osg::Operation("MotionBlur",true),
cleared_(false), cleared_(false),
persistence_(persistence) persistence_(persistence)

View File

@ -261,6 +261,7 @@ class TestSupportOperation: public osg::GraphicsOperation
public: public:
TestSupportOperation(): TestSupportOperation():
osg::Referenced(true),
osg::GraphicsOperation("TestSupportOperation",false), osg::GraphicsOperation("TestSupportOperation",false),
_supported(true), _supported(true),
_errorMessage() {} _errorMessage() {}

View File

@ -559,6 +559,7 @@ class UpdateTextOperation : public osg::Operation
public: public:
UpdateTextOperation(const osg::Vec3& center, float diameter, osg::Group* group): UpdateTextOperation(const osg::Vec3& center, float diameter, osg::Group* group):
osg::Referenced(true),
Operation("UpdateTextOperation", true), Operation("UpdateTextOperation", true),
_center(center), _center(center),
_diameter(diameter), _diameter(diameter),

View File

@ -83,6 +83,7 @@ class LoadAndCompileOperation : public osg::Operation
public: public:
LoadAndCompileOperation(const std::string& filename, osgUtil::IncrementalCompileOperation* ico , osg::RefBlockCount* block): LoadAndCompileOperation(const std::string& filename, osgUtil::IncrementalCompileOperation* ico , osg::RefBlockCount* block):
osg::Referenced(true),
Operation("Load and compile Operation", false), Operation("Load and compile Operation", false),
_filename(filename), _filename(filename),
_incrementalCompileOperation(ico), _incrementalCompileOperation(ico),
@ -128,6 +129,7 @@ public:
MasterOperation(const std::string& filename, osgUtil::IncrementalCompileOperation* ico): MasterOperation(const std::string& filename, osgUtil::IncrementalCompileOperation* ico):
osg::Referenced(true),
Operation("Master reading operation",true), Operation("Master reading operation",true),
_filename(filename), _filename(filename),
_incrementalCompileOperation(ico) _incrementalCompileOperation(ico)

View File

@ -306,6 +306,7 @@ class TestSupportOperation: public osg::GraphicsOperation
public: public:
TestSupportOperation(): TestSupportOperation():
osg::Referenced(true),
osg::GraphicsOperation("TestSupportOperation",false), osg::GraphicsOperation("TestSupportOperation",false),
supported(true), supported(true),
errorMessage(), errorMessage(),

View File

@ -49,6 +49,7 @@ struct OSG_EXPORT GraphicsOperation : public Operation
struct OSG_EXPORT SwapBuffersOperation : public GraphicsOperation struct OSG_EXPORT SwapBuffersOperation : public GraphicsOperation
{ {
SwapBuffersOperation(): SwapBuffersOperation():
osg::Referenced(true),
GraphicsOperation("SwapBuffers",true) {} GraphicsOperation("SwapBuffers",true) {}
virtual void operator () (GraphicsContext* context); virtual void operator () (GraphicsContext* context);
@ -65,6 +66,7 @@ struct OSG_EXPORT BarrierOperation : public Operation, public OpenThreads::Barri
}; };
BarrierOperation(int numThreads, PreBlockOp op=NO_OPERATION, bool keep=true): BarrierOperation(int numThreads, PreBlockOp op=NO_OPERATION, bool keep=true):
osg::Referenced(true),
Operation("Barrier", keep), Operation("Barrier", keep),
OpenThreads::Barrier(numThreads), OpenThreads::Barrier(numThreads),
_preBlockOp(op) {} _preBlockOp(op) {}
@ -81,6 +83,7 @@ struct OSG_EXPORT BarrierOperation : public Operation, public OpenThreads::Barri
struct OSG_EXPORT ReleaseContext_Block_MakeCurrentOperation : public GraphicsOperation, public RefBlock struct OSG_EXPORT ReleaseContext_Block_MakeCurrentOperation : public GraphicsOperation, public RefBlock
{ {
ReleaseContext_Block_MakeCurrentOperation(): ReleaseContext_Block_MakeCurrentOperation():
osg::Referenced(true),
GraphicsOperation("ReleaseContext_Block_MakeCurrent", false) {} GraphicsOperation("ReleaseContext_Block_MakeCurrent", false) {}
virtual void release(); virtual void release();

View File

@ -52,7 +52,6 @@ class Operation : virtual public Referenced
public: public:
Operation(const std::string& name, bool keep): Operation(const std::string& name, bool keep):
osg::Referenced(true),
_name(name), _name(name),
_keep(keep) {} _keep(keep) {}
@ -75,14 +74,12 @@ class Operation : virtual public Referenced
/** Do the actual task of this operation.*/ /** Do the actual task of this operation.*/
virtual void operator () (Object*) = 0; virtual void operator () (Object*) = 0;
protected: protected:
Operation(): Operation():
Referenced(true),
_keep(false) {} _keep(false) {}
Operation(const Operation& op): Operation(const Operation& op):
Referenced(true),
_name(op._name), _name(op._name),
_keep(op._keep) {} _keep(op._keep) {}

View File

@ -98,6 +98,7 @@ void ReleaseContext_Block_MakeCurrentOperation::operator () (GraphicsContext* co
BlockAndFlushOperation::BlockAndFlushOperation(): BlockAndFlushOperation::BlockAndFlushOperation():
osg::Referenced(true),
GraphicsOperation("Block",false) GraphicsOperation("Block",false)
{ {
reset(); reset();
@ -115,6 +116,7 @@ void BlockAndFlushOperation::operator () (GraphicsContext*)
} }
FlushDeletedGLObjectsOperation::FlushDeletedGLObjectsOperation(double availableTime, bool keep): FlushDeletedGLObjectsOperation::FlushDeletedGLObjectsOperation(double availableTime, bool keep):
osg::Referenced(true),
GraphicsOperation("FlushDeletedGLObjectsOperation",keep), GraphicsOperation("FlushDeletedGLObjectsOperation",keep),
_availableTime(availableTime) _availableTime(availableTime)
{ {

View File

@ -22,6 +22,7 @@ using namespace OpenThreads;
struct BlockOperation : public Operation, public Block struct BlockOperation : public Operation, public Block
{ {
BlockOperation(): BlockOperation():
osg::Referenced(true),
Operation("Block",false) Operation("Block",false)
{ {
reset(); reset();

View File

@ -181,12 +181,14 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset)
// //
GLObjectsOperation::GLObjectsOperation(GLObjectsVisitor::Mode mode): GLObjectsOperation::GLObjectsOperation(GLObjectsVisitor::Mode mode):
osg::Referenced(true),
osg::GraphicsOperation("GLObjectOperation",false), osg::GraphicsOperation("GLObjectOperation",false),
_mode(mode) _mode(mode)
{ {
} }
GLObjectsOperation::GLObjectsOperation(osg::Node* subgraph, GLObjectsVisitor::Mode mode): GLObjectsOperation::GLObjectsOperation(osg::Node* subgraph, GLObjectsVisitor::Mode mode):
osg::Referenced(true),
osg::GraphicsOperation("GLObjectOperation",false), osg::GraphicsOperation("GLObjectOperation",false),
_subgraph(subgraph), _subgraph(subgraph),
_mode(mode) _mode(mode)

View File

@ -445,6 +445,7 @@ bool IncrementalCompileOperation::CompileSet::compile(CompileInfo& compileInfo)
// IncrementalCompileOperation // IncrementalCompileOperation
// //
IncrementalCompileOperation::IncrementalCompileOperation(): IncrementalCompileOperation::IncrementalCompileOperation():
osg::Referenced(true),
osg::GraphicsOperation("IncrementalCompileOperation",true), osg::GraphicsOperation("IncrementalCompileOperation",true),
_flushTimeRatio(0.5), _flushTimeRatio(0.5),
_conservativeTimeRatio(0.5), _conservativeTimeRatio(0.5),

View File

@ -1122,6 +1122,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
struct DrawInnerOperation : public osg::Operation struct DrawInnerOperation : public osg::Operation
{ {
DrawInnerOperation(RenderStage* stage, osg::RenderInfo& renderInfo) : DrawInnerOperation(RenderStage* stage, osg::RenderInfo& renderInfo) :
osg::Referenced(true),
osg::Operation("DrawInnerStage",false), osg::Operation("DrawInnerStage",false),
_stage(stage), _stage(stage),
_renderInfo(renderInfo) {} _renderInfo(renderInfo) {}

View File

@ -352,6 +352,7 @@ static OpenThreads::ReentrantMutex s_drawSerializerMutex;
// //
// Renderer // Renderer
Renderer::Renderer(osg::Camera* camera): Renderer::Renderer(osg::Camera* camera):
osg::Referenced(true),
osg::GraphicsOperation("Renderer",true), osg::GraphicsOperation("Renderer",true),
_camera(camera), _camera(camera),
_done(false), _done(false),