Moved helper classes into Protected section

This commit is contained in:
Robert Osfield 2008-07-23 21:49:07 +00:00
parent 86ca0860cc
commit dc05f2ef95
2 changed files with 51 additions and 48 deletions

View File

@ -33,8 +33,58 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
ImagePager(); ImagePager();
class OSGDB_EXPORT ImageThread : public osg::Referenced, public OpenThreads::Thread
{
public:
enum Mode
{
HANDLE_ALL_REQUESTS,
HANDLE_NON_HTTP,
HANDLE_ONLY_HTTP
};
ImageThread(ImagePager* pager, Mode mode, const std::string& name);
ImageThread(const ImageThread& dt, ImagePager* pager);
void setDone(bool done) { _done = done; }
bool getDone() const { return _done; }
virtual int cancel();
virtual void run();
protected:
virtual ~ImageThread();
bool _done;
Mode _mode;
ImagePager* _pager;
std::string _name;
};
virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, double timeToMergeBy, const osg::FrameStamp* framestamp);
/** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
virtual bool requiresUpdateSceneGraph() const;
/** Merge the changes to the scene graph. */
virtual void updateSceneGraph(double currentFrameTime);
int cancel();
protected:
virtual ~ImagePager();
// forward declare // forward declare
struct RequestQueue; struct RequestQueue;
struct SortFileRequestFunctor;
friend struct SortFileRequestFunctor;
struct ImageRequest : public osg::Referenced struct ImageRequest : public osg::Referenced
{ {
@ -86,53 +136,6 @@ class OSGDB_EXPORT ImagePager : public osg::NodeVisitor::ImageRequestHandler
ImagePager* _pager; ImagePager* _pager;
std::string _name; std::string _name;
}; };
class OSGDB_EXPORT ImageThread : public osg::Referenced, public OpenThreads::Thread
{
public:
enum Mode
{
HANDLE_ALL_REQUESTS,
HANDLE_NON_HTTP,
HANDLE_ONLY_HTTP
};
ImageThread(ImagePager* pager, Mode mode, const std::string& name);
ImageThread(const ImageThread& dt, ImagePager* pager);
void setDone(bool done) { _done = done; }
bool getDone() const { return _done; }
virtual int cancel();
virtual void run();
protected:
virtual ~ImageThread();
bool _done;
Mode _mode;
ImagePager* _pager;
std::string _name;
};
virtual void requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, double timeToMergeBy, const osg::FrameStamp* framestamp);
/** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
virtual bool requiresUpdateSceneGraph() const;
/** Merge the changes to the scene graph. */
virtual void updateSceneGraph(double currentFrameTime);
int cancel();
public:
virtual ~ImagePager();
OpenThreads::Mutex _run_mutex; OpenThreads::Mutex _run_mutex;
bool _startThreadCalled; bool _startThreadCalled;

View File

@ -24,7 +24,7 @@ using namespace osgDB;
// //
// SortFileRequestFunctor // SortFileRequestFunctor
// //
struct SortFileRequestFunctor struct ImagePager::SortFileRequestFunctor
{ {
bool operator() (const osg::ref_ptr<ImagePager::ImageRequest>& lhs,const osg::ref_ptr<ImagePager::ImageRequest>& rhs) const bool operator() (const osg::ref_ptr<ImagePager::ImageRequest>& lhs,const osg::ref_ptr<ImagePager::ImageRequest>& rhs) const
{ {