OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimProperty.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.com)
6 //
7 //*************************************************************************
8 // $Id: ossimProperty.cpp 19917 2011-08-09 11:12:24Z gpotts $
12 
13 RTTI_DEF1(ossimProperty, "ossimProperty", ossimObject);
14 
16 {
17  this->assign(rhs);
18 
19  return *this;
20 }
21 
23  :theName(name),
24  theReadOnlyFlag(false),
25  theChangeType(ossimPropertyChangeType_NOTSPECIFIED),
26  theModifiedFlag(false)
27 {
28 }
29 
31  :theName(rhs.theName),
32  theReadOnlyFlag(rhs.theReadOnlyFlag),
33  theChangeType(rhs.theChangeType),
34  theModifiedFlag(rhs.theModifiedFlag)
35 {
36 }
37 
39 {
40 }
41 
43 {
44  return theName;
45 }
46 
48 {
49  theName = name;
50 }
51 
53 {
54  theName = rhs.theName;
58 
59  return *this;
60 }
61 
63 {
64  ossimString result;
65 
66  valueToString(result);
67 
68  return result;
69 
70 }
71 
73 {
74  return 0;
75 }
76 
78 {
79  return 0;
80 }
81 
82 bool ossimProperty::isChangeTypeSet(int type)const
83 {
84  return ((type&theChangeType)!=0);
85 }
86 
88 {
90 }
91 
92 void ossimProperty::setChangeType(int type, bool on)
93 {
94  if(on)
95  {
97  }
98  else
99  {
100  theChangeType = static_cast<ossimPropertyChangeType>((~type)&theChangeType);
101  }
102 }
103 
105 {
107 }
108 
110 {
112 }
113 
115 {
116  return theChangeType;
117 }
118 
120 {
122 }
123 
125 {
127 }
128 
130 {
132 }
133 
135 {
137 }
138 
140 {
141  theReadOnlyFlag = flag;
142 }
143 
145 {
146  return theReadOnlyFlag;
147 }
148 
150 {
151  return (getReadOnlyFlag());
152 }
153 
155 {
156  theModifiedFlag = flag;
157 }
158 
160 {
161  return theModifiedFlag;
162 }
163 
165 {
166  return (theModifiedFlag == true);
167 }
168 
170 {
171  theModifiedFlag = false;
172 }
173 
175 {
176  theDescription = description;
177 }
178 
180 {
181  return theDescription;
182 }
183 
185 {
186  ossimObject::accept(visitor);
187 }
188 
190 {
192 
193  result->setTag(getName());
194  result->setText(valueToString());
195 
196  return result;
197 }
198 
200 {
201  const ossimContainerProperty* container = asContainer();
202  if(container)
203  {
204  ossim_uint32 nproperties = container->getNumberOfProperties();
205  ossim_uint32 propertiesIndex = 0;
206  for(propertiesIndex = 0; propertiesIndex < nproperties; ++propertiesIndex)
207  {
208  ossimString newPrefix = prefix + container->getName() + ".";
209  ossimRefPtr<ossimProperty> prop = container->theChildPropertyList[propertiesIndex];
210  if(prop.valid())
211  {
212  prop->saveState(kwl, newPrefix);
213  }
214  }
215  }
216  else
217  {
218  kwl.add(prefix + getName(), valueToString(), true);
219  }
220 }
221 
ossimProperty(const ossimString &name=ossimString(""))
ossimPropertyChangeType theChangeType
Definition: ossimProperty.h:82
void setTag(const ossimString &tag)
ossimPropertyChangeType getChangeType() const
virtual ossim_uint32 getNumberOfProperties() const
void setText(const ossimString &text)
virtual ~ossimProperty()
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void accept(ossimVisitor &visitor)
void clearModifiedFlag()
const ossimProperty & operator=(const ossimProperty &rhs)
void setChangeType(int type, bool on=true)
ossimString theName
Definition: ossimProperty.h:79
virtual void setReadOnlyFlag(bool flag)
virtual const ossimProperty & assign(const ossimProperty &rhs)
std::vector< ossimRefPtr< ossimProperty > > theChildPropertyList
ossimString theDescription
Definition: ossimProperty.h:80
virtual ossimString valueToString() const
void setFullRefreshBit()
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool isCacheRefresh() const
void clearChangeType()
virtual void saveState(ossimKeywordlist &kwl, const ossimString &prefix="") const
virtual void accept(ossimVisitor &visitor)
bool isChangeTypeSpecified() const
RTTI_DEF1(ossimProperty, "ossimProperty", ossimObject)
unsigned int ossim_uint32
virtual const ossimContainerProperty * asContainer() const
virtual ossimRefPtr< ossimXmlNode > toXml() const
bool isFullRefresh() const
bool theModifiedFlag
Definition: ossimProperty.h:83
bool affectsOthers() const
bool isModified() const
void setDescription(const ossimString &description)
virtual ossimString getDescription() const
void setModifiedFlag(bool flag)
bool getReadOnlyFlag() const
void setName(const ossimString &name)
bool isChangeTypeSet(int type) const
bool theReadOnlyFlag
Definition: ossimProperty.h:81
void setCacheRefreshBit()
const ossimString & getName() const
bool getModifiedFlag() const
bool isReadOnly() const