VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtReadFileCallback.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <osgDB/Registry>
14 
15 #include <string>
16 #include <shared_mutex>
17 
18 namespace makVrv
19 {
20  class DtOsgFileCache;
21 
23  {
24  public:
26 
27  virtual ~DtReadFileCallback();
28 
29  osgDB::ReaderWriter::ReadResult openArchive(
30  const std::string& filename, osgDB::ReaderWriter::ArchiveStatus status,
31  unsigned int indexBlockSizeHint,
32  const osgDB::ReaderWriter::Options* useObjectCache) override;
33 
34  osgDB::ReaderWriter::ReadResult readObject(
35  const std::string& filename, const osgDB::ReaderWriter::Options* options) override;
36 
37  osgDB::ReaderWriter::ReadResult readImage(
38  const std::string& filename, const osgDB::ReaderWriter::Options* options) override;
39 
40  osgDB::ReaderWriter::ReadResult readHeightField(
41  const std::string& filename, const osgDB::ReaderWriter::Options* options) override;
42 
43  osgDB::ReaderWriter::ReadResult readNode(
44  const std::string& filename, const osgDB::ReaderWriter::Options* options) override;
45 
46  osgDB::ReaderWriter::ReadResult readShader(
47  const std::string& filename, const osgDB::ReaderWriter::Options* options) override;
48 
49  protected:
50 
52  mutable std::shared_timed_mutex myCacheValidMutex;
53 
55  DtOsgFileCache* myCache = nullptr;
56 
59  void deactivate();
60 
61  friend class DtOsgFileCache;
62  };
63 }
osgDB::ReaderWriter::ReadResult readNode(const std::string &filename, const osgDB::ReaderWriter::Options *options) override
void deactivate()
called by the creator DtOsgFileCache to indicate that the cache is no longer valid and should not be ...
osgDB::ReaderWriter::ReadResult readImage(const std::string &filename, const osgDB::ReaderWriter::Options *options) override
osgDB::ReaderWriter::ReadResult openArchive(const std::string &filename, osgDB::ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const osgDB::ReaderWriter::Options *useObjectCache) override
DtReadFileCallback(DtOsgFileCache *cache)
std::shared_timed_mutex myCacheValidMutex
read/write mutex protecting the myCache raw pointer
Definition: DtReadFileCallback.h:52
osgDB::ReaderWriter::ReadResult readShader(const std::string &filename, const osgDB::ReaderWriter::Options *options) override
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:56
osgDB::ReaderWriter::ReadResult readHeightField(const std::string &filename, const osgDB::ReaderWriter::Options *options) override
Definition: DtReadFileCallback.h:22
osgDB::ReaderWriter::ReadResult readObject(const std::string &filename, const osgDB::ReaderWriter::Options *options) override
Contains DLL export macros.
DtOsgFileCache * myCache
(raw) pointer to the file cache to use under the hood
Definition: DtReadFileCallback.h:55

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)