OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ossimH5Options Class Reference

#include <ossimH5Options.h>

Public Types

typedef std::vector< std::string > StringListType
 

Public Member Functions

bool loadOptions (const ossimKeywordlist &kwl, const char *prefix)
 
ossim_uint32 getMaxRecursionLevel () const
 
bool isDatasetRenderable (const std::string &datasetName) const
 
bool isDatasetExcluded (const std::string &datasetName) const
 
const StringListTypegetRenderableDataset () const
 

Static Public Member Functions

static ossimH5Optionsinstance ()
 

Protected Member Functions

 ossimH5Options ()
 
 ossimH5Options (const ossimH5Options &)
 
void operator= (const ossimH5Options &) const
 

Static Protected Member Functions

static void loadRenderableDatasetsFromString (StringListType &result, const ossimString &datasets)
 

Protected Attributes

ossim_uint32 m_maxRecursionLevel
 
StringListType m_renderableDatasets
 

Static Protected Attributes

static ossimH5Optionsm_instance =0
 

Detailed Description

Definition at line 5 of file ossimH5Options.h.

Member Typedef Documentation

◆ StringListType

typedef std::vector<std::string> ossimH5Options::StringListType

Definition at line 8 of file ossimH5Options.h.

Constructor & Destructor Documentation

◆ ossimH5Options() [1/2]

ossimH5Options::ossimH5Options ( )
protected

Override the compiler default constructors:

Definition at line 10 of file ossimH5Options.cpp.

References ossimPreferences::instance(), loadOptions(), and m_renderableDatasets.

Referenced by instance().

12 {
13  m_renderableDatasets.push_back("/All_Data/VIIRS-DNB-SDR_All/Radiance");
14 
15  loadOptions(ossimPreferences::instance()->preferencesKWL(), "hdf5.options.");
16 }
ossim_uint32 m_maxRecursionLevel
static ossimPreferences * instance()
bool loadOptions(const ossimKeywordlist &kwl, const char *prefix)
StringListType m_renderableDatasets

◆ ossimH5Options() [2/2]

ossimH5Options::ossimH5Options ( const ossimH5Options )
inlineprotected

Definition at line 30 of file ossimH5Options.h.

30 {}

Member Function Documentation

◆ getMaxRecursionLevel()

ossim_uint32 ossimH5Options::getMaxRecursionLevel ( ) const

Definition at line 36 of file ossimH5Options.cpp.

References m_maxRecursionLevel.

37 {
38  return m_maxRecursionLevel;
39 }
ossim_uint32 m_maxRecursionLevel

◆ getRenderableDataset()

const ossimH5Options::StringListType & ossimH5Options::getRenderableDataset ( ) const

Definition at line 48 of file ossimH5Options.cpp.

References m_renderableDatasets.

49 {
50  return m_renderableDatasets;
51 }
StringListType m_renderableDatasets

◆ instance()

ossimH5Options * ossimH5Options::instance ( )
static

Simply return the instance if already created:

Create the static instance of this class:

Definition at line 18 of file ossimH5Options.cpp.

References m_instance, and ossimH5Options().

Referenced by ossimH5ImageHandler::addImageDatasetEntries(), ossim_hdf5::isLoadableAsImage(), ossim_hdf5::iterateGroupForDatasetNames(), ossimSharedLibraryInitialize(), and ossim_hdf5::printIterative().

19 {
23  if (m_instance)
24  {
25  return m_instance;
26  }
27 
31  m_instance = new ossimH5Options();
32 
33  return m_instance;
34 }
static ossimH5Options * m_instance

◆ isDatasetExcluded()

bool ossimH5Options::isDatasetExcluded ( const std::string &  datasetName) const

◆ isDatasetRenderable()

bool ossimH5Options::isDatasetRenderable ( const std::string &  datasetName) const

Definition at line 41 of file ossimH5Options.cpp.

References m_renderableDatasets.

Referenced by ossimH5ImageHandler::addImageDatasetEntries(), and ossim_hdf5::isLoadableAsImage().

42 {
43  return std::binary_search (m_renderableDatasets.begin(),
44  m_renderableDatasets.end(),
45  datasetName);
46 }
StringListType m_renderableDatasets

◆ loadOptions()

bool ossimH5Options::loadOptions ( const ossimKeywordlist kwl,
const char *  prefix 
)

METHOD: loadPreferences() These methods clear the current preferences and load either the default preferences file or the specified file. Returns TRUE if loaded properly:

Definition at line 68 of file ossimH5Options.cpp.

References ossimKeywordlist::find(), loadRenderableDatasetsFromString(), m_maxRecursionLevel, m_renderableDatasets, MAX_RECURSION_LEVEL_KW, RENDERABLE_DATASETS_KW, and ossimString::toUInt32().

Referenced by ossimH5Options().

69 {
70  bool result = true;
71 
72  const char* maxRecursionLevel = kwl.find(prefix, MAX_RECURSION_LEVEL_KW);
73  if(maxRecursionLevel)
74  {
75  m_maxRecursionLevel = ossimString(maxRecursionLevel).toUInt32();
77  }
78  const char* renderableDatasets = kwl.find(prefix, RENDERABLE_DATASETS_KW);
79  if(renderableDatasets)
80  {
82  }
83 
84  return result;
85 }
ossim_uint32 m_maxRecursionLevel
const char * find(const char *key) const
static void loadRenderableDatasetsFromString(StringListType &result, const ossimString &datasets)
ossim_uint32 toUInt32() const
const char * MAX_RECURSION_LEVEL_KW
const char * RENDERABLE_DATASETS_KW
StringListType m_renderableDatasets

◆ loadRenderableDatasetsFromString()

void ossimH5Options::loadRenderableDatasetsFromString ( StringListType result,
const ossimString datasets 
)
staticprotected

Definition at line 53 of file ossimH5Options.cpp.

References ossimString::empty(), ossimString::push_back(), ossimString::split(), and ossimString::trim().

Referenced by loadOptions().

54 {
55  std::vector<ossimString> splitList;
56  result.clear();
57  datasets.split(splitList, ",");
58  ossim_uint32 idx = 0;
59  for(;idx < splitList.size();++idx)
60  {
61  ossimString tempString = splitList[idx].trim();
62  if(!tempString.empty()) result.push_back(tempString);
63  }
64 
65  std::sort(result.begin(), result.end());
66 }
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
bool empty() const
Definition: ossimString.h:411

◆ operator=()

void ossimH5Options::operator= ( const ossimH5Options ) const
inlineprotected

Definition at line 32 of file ossimH5Options.h.

32 {}

Member Data Documentation

◆ m_instance

ossimH5Options * ossimH5Options::m_instance =0
staticprotected

Definition at line 36 of file ossimH5Options.h.

Referenced by instance().

◆ m_maxRecursionLevel

ossim_uint32 ossimH5Options::m_maxRecursionLevel
protected

Definition at line 38 of file ossimH5Options.h.

Referenced by getMaxRecursionLevel(), and loadOptions().

◆ m_renderableDatasets

StringListType ossimH5Options::m_renderableDatasets
protected

The documentation for this class was generated from the following files: