osgEarth 2.1.1
|
Public Types | |
enum | Mode { MODE_SERIAL, MODE_PARALLEL, MODE_SEQUENTIAL, MODE_PREEMPTIVE, MODE_STANDARD = MODE_SERIAL } |
Public Member Functions | |
LoadingPolicy (const Config &conf=Config()) | |
LoadingPolicy (const Mode &mode) | |
virtual Config | getConfig () const |
virtual void | fromConfig (const Config &conf) |
optional< Mode > & | mode () |
const optional< Mode > & | mode () const |
optional< float > & | numLoadingThreadsPerCore () |
const optional< float > & | numLoadingThreadsPerCore () const |
const optional< int > & | numLoadingThreads () const |
optional< int > & | numLoadingThreads () |
const optional< int > & | numCompileThreads () const |
optional< int > & | numCompileThreads () |
const optional< float > & | numCompileThreadsPerCore () const |
optional< float > & | numCompileThreadsPerCore () |
Protected Attributes | |
optional< Mode > | _mode |
optional< int > | _numLoadingThreads |
optional< float > | _numLoadingThreadsPerCore |
optional< int > | _numCompileThreads |
optional< float > | _numCompileThreadsPerCore |
The LoadingPolicy configures how the terrain engine loads map data.
Definition at line 31 of file TerrainOptions.
Tile loading modes.
Definition at line 35 of file TerrainOptions.
Definition at line 28 of file TerrainOptions.cpp.
: _mode( MODE_STANDARD ), _numLoadingThreads( 4 ), _numLoadingThreadsPerCore( 2 ), _numCompileThreads( 2 ), _numCompileThreadsPerCore( 0.5 ) { fromConfig( conf ); }
osgEarth::LoadingPolicy::LoadingPolicy | ( | const Mode & | mode | ) |
void LoadingPolicy::fromConfig | ( | const Config & | conf | ) | [virtual] |
Definition at line 39 of file TerrainOptions.cpp.
{ conf.getIfSet( "mode", "standard", _mode, MODE_SERIAL ); conf.getIfSet( "mode", "serial", _mode, MODE_SERIAL ); conf.getIfSet( "mode", "parallel", _mode, MODE_PARALLEL ); conf.getIfSet( "mode", "sequential", _mode, MODE_SEQUENTIAL ); conf.getIfSet( "mode", "preemptive", _mode, MODE_PREEMPTIVE ); conf.getIfSet( "loading_threads", _numLoadingThreads ); conf.getIfSet( "loading_threads_per_logical_processor", _numLoadingThreadsPerCore ); conf.getIfSet( "loading_threads_per_core", _numLoadingThreadsPerCore ); conf.getIfSet( "compile_threads", _numCompileThreads ); conf.getIfSet( "compile_threads_per_core", _numCompileThreadsPerCore ); }
Config LoadingPolicy::getConfig | ( | ) | const [virtual] |
Definition at line 54 of file TerrainOptions.cpp.
{ Config conf( "loading_policy" ); conf.addIfSet( "mode", "standard", _mode, MODE_STANDARD ); // aka MODE_SERIAL conf.addIfSet( "mode", "parallel", _mode, MODE_PARALLEL ); conf.addIfSet( "mode", "sequential", _mode, MODE_SEQUENTIAL ); conf.addIfSet( "mode", "preemptive", _mode, MODE_PREEMPTIVE ); conf.addIfSet( "loading_threads", _numLoadingThreads ); conf.addIfSet( "loading_threads_per_core", _numLoadingThreadsPerCore ); conf.addIfSet( "compile_threads", _numCompileThreads ); conf.addIfSet( "compile_threads_per_core", _numCompileThreadsPerCore ); return conf; }
Definition at line 67 of file TerrainOptions.
{ return _mode; }
Gets or sets the tile loading mode.
Definition at line 66 of file TerrainOptions.
{ return _mode; }
const optional<int>& osgEarth::LoadingPolicy::numCompileThreads | ( | ) | const [inline] |
Gets or sets the number of threads to allocate for regenerating terrain tiles in the background. This only applies in SEQUENTIAL or PREEMPTIVE mode.
Definition at line 94 of file TerrainOptions.
{ return _numCompileThreads; }
optional<int>& osgEarth::LoadingPolicy::numCompileThreads | ( | ) | [inline] |
Definition at line 95 of file TerrainOptions.
{ return _numCompileThreads; }
const optional<float>& osgEarth::LoadingPolicy::numCompileThreadsPerCore | ( | ) | const [inline] |
Gets or sets the number of threads to allocate for regenerating terrain tiles in the background. This only applies in SEQUENTIAL or PREEMPTIVE mode.
Definition at line 102 of file TerrainOptions.
{ return _numCompileThreadsPerCore; }
optional<float>& osgEarth::LoadingPolicy::numCompileThreadsPerCore | ( | ) | [inline] |
Definition at line 103 of file TerrainOptions.
{ return _numCompileThreadsPerCore; }
const optional<int>& osgEarth::LoadingPolicy::numLoadingThreads | ( | ) | const [inline] |
Gets or sets the total number of loading threads to use.
In STANDARD mode, this affects the number of OSG database pager threads; in SEQUENTIAL or PREEMPTIVE mode, this sets the number of task thread pool threads.
Definition at line 86 of file TerrainOptions.
{ return _numLoadingThreads; }
optional<int>& osgEarth::LoadingPolicy::numLoadingThreads | ( | ) | [inline] |
Definition at line 87 of file TerrainOptions.
{ return _numLoadingThreads; }
optional<float>& osgEarth::LoadingPolicy::numLoadingThreadsPerCore | ( | ) | [inline] |
Gets or sets the number of loading threads to use per CPU core.
In STANDARD mode, this affects the number of OSG database pager threads; in SEQUENTIAL or PREEMPTIVE mode, this sets the number of task thread pool threads.
Definition at line 76 of file TerrainOptions.
{ return _numLoadingThreadsPerCore; }
const optional<float>& osgEarth::LoadingPolicy::numLoadingThreadsPerCore | ( | ) | const [inline] |
Definition at line 77 of file TerrainOptions.
{ return _numLoadingThreadsPerCore; }
optional<Mode> osgEarth::LoadingPolicy::_mode [protected] |
Definition at line 106 of file TerrainOptions.
optional<int> osgEarth::LoadingPolicy::_numCompileThreads [protected] |
Definition at line 109 of file TerrainOptions.
optional<float> osgEarth::LoadingPolicy::_numCompileThreadsPerCore [protected] |
Definition at line 110 of file TerrainOptions.
optional<int> osgEarth::LoadingPolicy::_numLoadingThreads [protected] |
Definition at line 107 of file TerrainOptions.
optional<float> osgEarth::LoadingPolicy::_numLoadingThreadsPerCore [protected] |
Definition at line 108 of file TerrainOptions.