OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPropertyInterface.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks)
6 //
7 //*************************************************************************
8 // $Id: ossimPropertyInterface.cpp 17195 2010-04-23 17:32:18Z dburken $
11 
12 RTTI_DEF(ossimPropertyInterface, "ossimPropertyInterface");
13 
15  const ossimString& value)
16 {
17  ossimRefPtr<ossimProperty> property = new ossimStringProperty(name, value);
18 
19  setProperty(property);
20 }
21 
23 {
24 }
25 
27 {
28  return (ossimProperty*)0;
29 }
30 
31 void ossimPropertyInterface::getPropertyNames(std::vector<ossimString>& /* propertyNames */)const
32 {
33 }
34 
36 {
38  if(prop.valid())
39  {
40  return prop->valueToString();
41  }
42 
43  return ossimString("");
44 }
45 
46 
48 {
49  std::vector<ossimString> propertyNames;
50  int idx = 0;
51  getPropertyNames(propertyNames);
52 
53  for(idx = 0; idx < (int)propertyNames.size();++idx)
54  {
55  ossimRefPtr<ossimProperty> prop = getProperty(propertyNames[idx]);
56  if(prop.valid())
57  {
58  propertyList.push_back(prop);
59  }
60  }
61 }
62 
64 {
65  ossim_uint32 idx = 0;
66 
67  for(idx = 0; idx < propertyList.size(); ++idx)
68  {
69  if(propertyList[idx].valid())
70  {
71  setProperty(propertyList[idx]);
72  }
73  }
74 }
virtual void valueToString(ossimString &valueResult) const =0
void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
void setProperties(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
RTTI_DEF(ossimPropertyInterface, "ossimPropertyInterface")
bool valid() const
Definition: ossimRefPtr.h:75
unsigned int ossim_uint32
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void setProperty(const ossimString &name, const ossimString &value)
virtual ossimString getPropertyValueAsString(const ossimString &name) const