Skip to content
Snippets Groups Projects
Commit 6dd24e6b authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

BugID: 992

ParameterSets can now be constructed with optional case-insensitive keys. The
trick is to use a third template parameter for the std::map<> that is used to
store the key/value pairs: a functor for doing either case sensitive or case
insensitive comparison. The ParameterSet constructor now takes an optional
boolean argument indicating whether keys should be treated case sensitive or
not. The makeSubset() member function will also take key case sensitivity into
account.
parent 8690b770
No related branches found
No related tags found
No related merge requests found
...@@ -57,14 +57,23 @@ public: ...@@ -57,14 +57,23 @@ public:
// read from a file or copied from another collection. // read from a file or copied from another collection.
// @{ // @{
// Create an empty collection. // Create an empty collection. The optional argument \a keyNoCase
ParameterSet(); // determines whether keys should be compared case insensitive.
explicit ParameterSet(bool keyNoCase = false);
// Destroy the contents. // Destroy the contents.
~ParameterSet(); ~ParameterSet();
// The ParameterSet may be construction by reading a param. file. // The ParameterSet may be construction by reading a param. file. The
explicit ParameterSet(const string& theFilename); // optional argument \a keyNoCase determines whether keys should be
// compared case insensitive.
// @{
explicit ParameterSet(const string& theFilename,
bool keyNoCase = false);
explicit ParameterSet(const char* theFilename,
bool keyNoCase = false);
// @}
// Copying is allowed. // Copying is allowed.
ParameterSet(const ParameterSet& that); ParameterSet(const ParameterSet& that);
...@@ -258,7 +267,7 @@ inline void ParameterSet::adoptCollection(const ParameterSet& theCollection) ...@@ -258,7 +267,7 @@ inline void ParameterSet::adoptCollection(const ParameterSet& theCollection)
inline void ParameterSet::writeFile (const string& theFilename, bool append) const inline void ParameterSet::writeFile (const string& theFilename, bool append) const
{ {
itsSet->writeFile (theFilename, append); itsSet->writeFile (theFilename.c_str(), append);
} }
inline void ParameterSet::writeBuffer ( string& theBuffer) const inline void ParameterSet::writeBuffer ( string& theBuffer) const
......
...@@ -51,33 +51,41 @@ const char PC_QUAL_DEVELOP[] = { "development" }; ...@@ -51,33 +51,41 @@ const char PC_QUAL_DEVELOP[] = { "development" };
const char PC_KEY_VERSIONNR[] = { "versionnr" }; const char PC_KEY_VERSIONNR[] = { "versionnr" };
const char PC_KEY_QUAL[] = { "qualification" }; const char PC_KEY_QUAL[] = { "qualification" };
// A key/value map is defined as a map of strings. The third template
// parameter, \c StringUtil::Compare, is the string comparison functor that
// will be used to compare keys.
typedef map <string, string, StringUtil::Compare> KeyValueMap;
//# Description of class. //# Description of class.
// The ParameterSetImpl class is a key-value implementation of the type // The ParameterSetImpl class is a key-value implementation of the type
// map<string, string>. // map<string, string, StringUtil::Compare>.
// This means that values are stored as a string which allows easy merging and // This means that values are stored as a string which allows easy merging and
// splitting of ParameterSetImpls because no conversions have to be done. // splitting of ParameterSetImpls because no conversions have to be done.
// A couple of getXxx routines are provided to convert the strings to the // A couple of getXxx routines are provided to convert the strings to the
// desired type. // desired type.
// //
class ParameterSetImpl : public map <string, string> class ParameterSetImpl : public KeyValueMap
{ {
public: public:
typedef map<string, string>::iterator iterator; typedef KeyValueMap::iterator iterator;
typedef map<string, string>::const_iterator const_iterator; typedef KeyValueMap::const_iterator const_iterator;
// \name Construction and Destruction // \name Construction and Destruction
// A ParameterSetImpl can be constructed as empty collection, can be // A ParameterSetImpl can be constructed as empty collection, can be
// read from a file or copied from another collection. // read from a file or copied from another collection.
// @{ // @{
// Create an empty collection. // Create an empty collection. If a keyNoCase is \c true, then key
ParameterSetImpl(); // comparison is case insensitive.
explicit ParameterSetImpl(bool keyNoCase);
// Destroy the contents. // Destroy the contents.
~ParameterSetImpl(); ~ParameterSetImpl();
// The ParameterSetImpl may be construction by reading a param. file. // The ParameterSetImpl may be construction by reading a param. file.
explicit ParameterSetImpl(const string& theFilename); // If a keyNoCase is \c true, then key comparison is case insensitive.
explicit ParameterSetImpl(const char* theFilename,
bool keyNoCase);
// @} // @}
// Deal with the reference count. // Deal with the reference count.
...@@ -109,7 +117,7 @@ public: ...@@ -109,7 +117,7 @@ public:
// @{ // @{
// Writes the Key-Values pair from the current ParCollection to the file. // Writes the Key-Values pair from the current ParCollection to the file.
void writeFile (const string& theFilename, bool append = false) const; void writeFile (const char* theFilename, bool append = false) const;
// Writes the Key-Values pair from the current ParCollection to the // Writes the Key-Values pair from the current ParCollection to the
// string buffer. // string buffer.
...@@ -223,15 +231,18 @@ private: ...@@ -223,15 +231,18 @@ private:
// methods do some preprocessing so the 'adopt' method can use the // methods do some preprocessing so the 'adopt' method can use the
// \c addStream method. // \c addStream method.
// @{ // @{
void readFile (const string& theFile, const bool merge); void readFile (const char* theFile, const bool merge);
void readBuffer (const string& theFile, const bool merge); void readBuffer (const string& theFile, const bool merge);
void addStream (istream& inputStream, const bool merge); void addStream (istream& inputStream, const bool merge);
// @} // @}
const_iterator findKV(const string& aKey) const; const_iterator findKV(const string& aKey) const;
//# Reference count. // Reference count.
int itsCount; int itsCount;
// Indicates whether case should be ignored when comparing keys.
bool itsKeyNoCase;
}; };
//# -------------------- Global functions -------------------- //# -------------------- Global functions --------------------
......
...@@ -48,15 +48,21 @@ ParameterSet* globalParameterSet() ...@@ -48,15 +48,21 @@ ParameterSet* globalParameterSet()
// //
// Default constructor // Default constructor
// //
ParameterSet::ParameterSet() ParameterSet::ParameterSet(bool keyNoCase)
: itsSet (new ParameterSetImpl()) : itsSet (new ParameterSetImpl(keyNoCase))
{} {}
// //
// Construction by reading a parameter file. // Construction by reading a parameter file.
// //
ParameterSet::ParameterSet(const string& theFilename) ParameterSet::ParameterSet(const string& theFilename,
: itsSet (new ParameterSetImpl(theFilename)) bool keyNoCase)
: itsSet (new ParameterSetImpl(theFilename.c_str(), keyNoCase))
{}
ParameterSet::ParameterSet(const char* theFilename,
bool keyNoCase)
: itsSet (new ParameterSetImpl(theFilename, keyNoCase))
{} {}
// //
......
...@@ -37,15 +37,24 @@ namespace LOFAR { ...@@ -37,15 +37,24 @@ namespace LOFAR {
// //
// Default constructor // Default constructor
// //
ParameterSetImpl::ParameterSetImpl() ParameterSetImpl::ParameterSetImpl(bool keyNoCase)
: itsCount (1) : KeyValueMap(keyNoCase ?
StringUtil::Compare::NOCASE :
StringUtil::Compare::NORMAL),
itsCount (1),
itsKeyNoCase(keyNoCase)
{} {}
// //
// Construction by reading a parameter file. // Construction by reading a parameter file.
// //
ParameterSetImpl::ParameterSetImpl(const string& theFilename) ParameterSetImpl::ParameterSetImpl(const char* theFilename,
: itsCount (1) bool keyNoCase)
: KeyValueMap(keyNoCase ?
StringUtil::Compare::NOCASE :
StringUtil::Compare::NORMAL),
itsCount (1),
itsKeyNoCase(keyNoCase)
{ {
readFile(theFilename, false); readFile(theFilename, false);
} }
...@@ -61,7 +70,7 @@ ParameterSetImpl::~ParameterSetImpl() ...@@ -61,7 +70,7 @@ ParameterSetImpl::~ParameterSetImpl()
// //
std::ostream& operator<< (std::ostream& os, const ParameterSetImpl &thePS) std::ostream& operator<< (std::ostream& os, const ParameterSetImpl &thePS)
{ {
map<string,string>::const_iterator iter = thePS.begin(); KeyValueMap::const_iterator iter = thePS.begin();
while (iter != thePS.end()) { while (iter != thePS.end()) {
os << "[" << iter->first << "],[" << iter->second << "]" << endl; os << "[" << iter->first << "],[" << iter->second << "]" << endl;
...@@ -80,27 +89,35 @@ std::ostream& operator<< (std::ostream& os, const ParameterSetImpl &thePS) ...@@ -80,27 +89,35 @@ std::ostream& operator<< (std::ostream& os, const ParameterSetImpl &thePS)
// The baseKey is cut off from the Keynames in the created subset, the // The baseKey is cut off from the Keynames in the created subset, the
// optional prefix is put before the keynames. // optional prefix is put before the keynames.
// //
ParameterSetImpl* ParameterSetImpl::makeSubset(const string& baseKey, ParameterSetImpl*
const string& prefix) const ParameterSetImpl::makeSubset(const string& baseKey,
{ const string& prefix) const
const_iterator scanner = begin(); {
int baseKeyLen = strlen(baseKey.c_str()); const_iterator scanner = begin();
ParameterSetImpl* subSet = new ParameterSetImpl(); uint baseKeyLen = baseKey.size();
ParameterSetImpl* subSet = new ParameterSetImpl(itsKeyNoCase);
LOG_TRACE_CALC_STR("makeSubSet(" << baseKey << "," << prefix << ")");
LOG_TRACE_CALC_STR("makeSubSet(" << baseKey << "," << prefix << ")");
// Scan through whole ParameterSetImpl
while (scanner != end()) { // Scan through whole ParameterSetImpl
// starts with basekey? while (scanner != end()) {
if (!scanner->first.compare(0, baseKeyLen, baseKey)) { // starts with basekey?
// cut off baseString and copy to subset bool match;
subSet->insert(make_pair(prefix+scanner->first.substr(baseKeyLen), if (itsKeyNoCase) {
scanner->second)); match = !toLower(scanner->first).compare(0,baseKeyLen,toLower(baseKey));
} } else {
scanner++; match = !scanner->first.compare(0,baseKeyLen,baseKey);
} }
if (match) {
return (subSet); LOG_TRACE_VAR_STR(baseKey << " matches with " << scanner->first);
// cut off baseString and copy to subset
subSet->insert(make_pair(prefix+scanner->first.substr(baseKeyLen),
scanner->second));
}
scanner++;
}
return (subSet);
} }
// //
...@@ -110,7 +127,7 @@ ParameterSetImpl* ParameterSetImpl::makeSubset(const string& baseKey, ...@@ -110,7 +127,7 @@ ParameterSetImpl* ParameterSetImpl::makeSubset(const string& baseKey,
// //
void ParameterSetImpl::adoptFile(const string& theFilename) void ParameterSetImpl::adoptFile(const string& theFilename)
{ {
readFile(theFilename, true); readFile(theFilename.c_str(), true);
} }
// //
...@@ -144,16 +161,16 @@ void ParameterSetImpl::adoptCollection(const ParameterSetImpl& theCollection) ...@@ -144,16 +161,16 @@ void ParameterSetImpl::adoptCollection(const ParameterSetImpl& theCollection)
// //
// Disentangles the file and adds the Key-Values pair to the current ParameterSetImpl. // Disentangles the file and adds the Key-Values pair to the current ParameterSetImpl.
// //
void ParameterSetImpl::readFile(const string& theFilename, void ParameterSetImpl::readFile(const char* theFilename,
const bool merge) const bool merge)
{ {
ifstream paramFile; ifstream paramFile;
// Try to pen the file // Try to pen the file
paramFile.open(theFilename.c_str(), ifstream::in); paramFile.open(theFilename, ifstream::in);
if (!paramFile) { if (!paramFile) {
THROW (APSException, THROW (APSException,
formatString("Unable to open file %s", theFilename.c_str())); formatString("Unable to open file %s", theFilename));
} }
addStream(paramFile, merge); addStream(paramFile, merge);
...@@ -285,7 +302,7 @@ void ParameterSetImpl::addStream(istream& inputStream, bool merge) ...@@ -285,7 +302,7 @@ void ParameterSetImpl::addStream(istream& inputStream, bool merge)
keyStr)); keyStr));
} }
// Finally add to map // Finally add to map
pair< map<string, string>::iterator, bool> result; pair< KeyValueMap::iterator, bool> result;
result = insert(std::make_pair(keyStr, valueStr)); result = insert(std::make_pair(keyStr, valueStr));
if (!result.second) { if (!result.second) {
THROW (APSException, THROW (APSException,
...@@ -321,7 +338,7 @@ ParameterSetImpl::findKV(const string& aKey) const ...@@ -321,7 +338,7 @@ ParameterSetImpl::findKV(const string& aKey) const
// //
void ParameterSetImpl::add(const string& aKey, const string& aValue) void ParameterSetImpl::add(const string& aKey, const string& aValue)
{ {
pair< map<string, string>::iterator, bool> result; pair< KeyValueMap::iterator, bool> result;
result = insert(std::make_pair(aKey, aValue)); result = insert(std::make_pair(aKey, aValue));
...@@ -677,16 +694,17 @@ vector<time_t> ParameterSetImpl::getTimeVector(const string& theKey) const ...@@ -677,16 +694,17 @@ vector<time_t> ParameterSetImpl::getTimeVector(const string& theKey) const
// Writes the Key-Values pair from the current ParameterSetImpl to the given file // Writes the Key-Values pair from the current ParameterSetImpl to the given file
// thereby overwritting any file contents. // thereby overwritting any file contents.
// //
void ParameterSetImpl::writeFile(const string& theFilename, void ParameterSetImpl::writeFile(const char* theFilename,
bool append) const bool append) const
{ {
ofstream paramFile; ofstream paramFile;
// Try to open the file // Try to open the file
paramFile.open(theFilename.c_str(), LOG_TRACE_STAT_STR("Writing parameter file `" << theFilename << "'");
paramFile.open(theFilename,
ofstream::out | (append ? ofstream::app : ofstream::trunc)); ofstream::out | (append ? ofstream::app : ofstream::trunc));
if (!paramFile) { if (!paramFile) {
THROW (APSException, formatString("Unable to open file %s", theFilename.c_str())); THROW (APSException, formatString("Unable to open file %s", theFilename));
} }
// Write all the pairs to the file // Write all the pairs to the file
......
...@@ -33,98 +33,109 @@ using namespace std; ...@@ -33,98 +33,109 @@ using namespace std;
using namespace LOFAR; using namespace LOFAR;
using namespace LOFAR::ACC::APS; using namespace LOFAR::ACC::APS;
int main() { int doIt(bool noCase)
try { {
INIT_LOGGER("tParameterSet"); string paramFile ("tParameterSet.in_param_");
string mergeFile ("tParameterSet.in_merge_");
cout << "\nReading in parameterfile 'tParameterSet.in_param'\n"; string newsetFile("tParameterSet_tmp.newset.");
cout << ">>>\n"; paramFile += (noCase ? "nocase" : "normal");
ParameterSet myPS("tParameterSet.in_param"); mergeFile += (noCase ? "nocase" : "normal");
cout << "<<<\n"; newsetFile += (noCase ? "nocase" : "normal");
ParameterSet mySecondSet(myPS); try
{
cout << "\nShowing some values\n"; cout << "\n>>>";
cout << "a.b.c=" << myPS.getInt32("a.b.c") << endl; cout << "\nReading in parameterfile '" << paramFile << "'\n";
cout << "a.b=" << myPS.getInt32("a.b") << endl; ParameterSet myPS(paramFile, noCase);
cout.precision(20); cout << "<<<\n";
cout << "a.b.double=" << myPS.getDouble("a.b.double") << endl;
cout << "a.b.lange_naam=" << myPS.getString("a.b.lange_naam") << endl; ParameterSet mySecondSet(myPS);
cout << "\nMerging ParameterSet with file 'tParameterSet.in_merge'\n"; cout << "\nShowing some values\n";
myPS.adoptFile("tParameterSet.in_merge"); cout << "a.b.c=" << myPS.getInt32("a.b.c") << endl;
cout << "a.b=" << myPS.getInt32("a.b") << endl;
cout << "\nShowing the same keys again\n"; cout.precision(20);
cout << "a.b.c=" << myPS.getInt32("a.b.c") << endl; cout << "a.b.double=" << myPS.getDouble("a.b.double") << endl;
cout << "a.b=" << myPS.getInt32("a.b") << endl; cout << "a.b.lange_naam=" << myPS.getString("a.b.lange_naam") << endl;
cout.precision(20);
cout << "a.b.double=" << myPS.getDouble("a.b.double") << endl; cout << "\n>>>";
cout << "a.b.lange_naam=" << myPS.getString("a.b.lange_naam") << endl; cout << "\nMerging ParameterSet with file '" << mergeFile << "'\n";
cout << "<<<\n";
cout << "a.b.time1=" << myPS.getTime("a.b.time1") << endl; myPS.adoptFile(mergeFile);
cout << "a.b.time2=" << myPS.getTime("a.b.time2") << endl;
cout << "a.b.time3=" << myPS.getTime("a.b.time3") << endl; cout << "\nShowing the same keys again\n";
cout << "a.b.c=" << myPS.getInt32("a.b.c") << endl;
cout << "\nThe main ParameterSet contains:\n"; cout << "a.b=" << myPS.getInt32("a.b") << endl;
cout << myPS; cout.precision(20);
cout << "a.b.double=" << myPS.getDouble("a.b.double") << endl;
cout << "Fullname of 'b'=" << myPS.locateModule("b") << endl; cout << "a.b.lange_naam=" << myPS.getString("a.b.lange_naam") << endl;
cout << "isValidVersionNr(1.2.3.4) = " << isValidVersionNr("1.2.3.4") << endl; cout << "a.b.time1=" << myPS.getTime("a.b.time1") << endl;
cout << "isValidVersionNr(1.2.3) = " << isValidVersionNr("1.2.3") << endl; cout << "a.b.time2=" << myPS.getTime("a.b.time2") << endl;
cout << "isValidVersionNr(1.2) = " << isValidVersionNr("1.2") << endl; cout << "a.b.time3=" << myPS.getTime("a.b.time3") << endl;
cout << "isValidVersionNr(stable) = " << isValidVersionNr("stable") << endl;
cout << "isValidVersionNrRef(1.2.3) = " << isValidVersionNrRef("1.2.3") << endl; cout << "\nThe main ParameterSet contains:\n";
cout << "isValidVersionNrRef(1.2) = " << isValidVersionNrRef("1.2") << endl; cout << myPS;
cout << "isValidVersionNrRef(stable) = " << isValidVersionNrRef("stable") << endl;
cout << "isValidVersionNrRef(error) = " << isValidVersionNrRef("error") << endl; cout << "Fullname of 'b'=" << myPS.locateModule("b") << endl;
cout << "isValidVersionNrRef(1.2.3.AndALotOfGarbageBehindTheLastNumberPart) = "
<< isValidVersionNrRef("1.2.3.AndALotOfGarbageBehindTheLastNumberPart"); cout << "isValidVersionNr(1.2.3.4) = " << isValidVersionNr("1.2.3.4") << endl;
cout << "isValidVersionNr(1.2.3) = " << isValidVersionNr("1.2.3") << endl;
ParameterSet mySubset = myPS.makeSubset("a.b."); cout << "isValidVersionNr(1.2) = " << isValidVersionNr("1.2") << endl;
cout << "\nCreating a subset 'a.b.'\n"; cout << "isValidVersionNr(stable) = " << isValidVersionNr("stable") << endl;
cout << "\nSubset a.b. contains:\n"; cout << "isValidVersionNrRef(1.2.3) = " << isValidVersionNrRef("1.2.3") << endl;
cout << mySubset; cout << "isValidVersionNrRef(1.2) = " << isValidVersionNrRef("1.2") << endl;
cout << "isValidVersionNrRef(stable) = " << isValidVersionNrRef("stable") << endl;
cout << "\nTrying to read a non-existing key\n"; cout << "isValidVersionNrRef(error) = " << isValidVersionNrRef("error") << endl;
cout << ">>>\n"; cout << "isValidVersionNrRef(1.2.3.AndALotOfGarbageBehindTheLastNumberPart) = "
try { << isValidVersionNrRef("1.2.3.AndALotOfGarbageBehindTheLastNumberPart");
myPS.getInt32("is.er.niet");
} ParameterSet mySubset = myPS.makeSubset("a.b.");
catch (LOFAR::Exception& ex) { cout << "\nCreating a subset 'a.b.'\n";
cout << "<<<\n"; cout << "\nSubset a.b. contains:\n";
cout << "Told you the key didn't exist." << endl; cout << mySubset;
}
cout << "\nTrying to read a non-existing key\n";
cout << "\nFinally write the parameterset to 'newset.stdout'\n"; cout << ">>>\n";
myPS.writeFile("tParameterSet_tmp.newset.stdout"); try {
myPS.getInt32("is.er.niet");
try { }
cout << "\ntesting getInt32Vector\n"; catch (LOFAR::Exception& ex) {
vector<int32> intVector = myPS.getInt32Vector("vtest.intVector1Dim"); cout << "<<<\n";
cout << intVector.size() << " elements in intVector1Dim\n"; cout << "Told you the key didn't exist." << endl;
copy (intVector.begin(), intVector.end(), }
std::ostream_iterator<int, char>(cout, ","));
cout << endl; cout << "\n>>>";
cout << "\nFinally write the parameterset to '" << newsetFile << "'\n";
cout << "trying to read single int as vector\n"; cout << "<<<\n";
intVector = myPS.getInt32Vector("a.b.c"); myPS.writeFile(newsetFile);
cout << intVector.size() << " elements in a.b.c\n";
copy (intVector.begin(), intVector.end(), try {
std::ostream_iterator<int, char>(cout, ",")); cout << "\ntesting getInt32Vector\n";
cout << endl; vector<int32> intVector = myPS.getInt32Vector("vtest.intVector1Dim");
} cout << intVector.size() << " elements in intVector1Dim\n";
catch (LOFAR::Exception& ex) { copy (intVector.begin(), intVector.end(),
LOG_DEBUG_STR ("Exception:" << ex.what()); std::ostream_iterator<int, char>(cout, ","));
} cout << endl;
// Iterate through all keys. cout << "trying to read single int as vector\n";
cout << endl << "Iterate over all keys ..." << endl; intVector = myPS.getInt32Vector("a.b.c");
for (ParameterSet::iterator iter = myPS.begin(); cout << intVector.size() << " elements in a.b.c\n";
iter != myPS.end(); copy (intVector.begin(), intVector.end(),
iter++) { std::ostream_iterator<int, char>(cout, ","));
cout << iter->first << endl; cout << endl;
} }
catch (LOFAR::Exception& ex) {
LOG_DEBUG_STR ("Exception:" << ex.what());
}
// Iterate through all keys.
cout << endl << "Iterate over all keys ..." << endl;
for (ParameterSet::iterator iter = myPS.begin();
iter != myPS.end();
iter++) {
cout << iter->first << endl;
}
} catch (std::exception& ex) { } catch (std::exception& ex) {
cout << "Unexpected exception: " << ex.what() << endl; cout << "Unexpected exception: " << ex.what() << endl;
...@@ -133,3 +144,16 @@ int main() { ...@@ -133,3 +144,16 @@ int main() {
return 0; return 0;
} }
int main()
{
INIT_LOGGER("tParameterSet");
uint fails(0);
fails += doIt(false);
fails += doIt(true);
if (fails > 0) {
LOG_ERROR_STR(fails << " test(s) failed");
return 1;
}
return 0;
}
Reading in parameterfile 'tParameterSet.in_param'
>>> >>>
Reading in parameterfile 'tParameterSet.in_param_normal'
<<< <<<
Showing some values Showing some values
...@@ -9,7 +9,9 @@ a.b=7 ...@@ -9,7 +9,9 @@ a.b=7
a.b.double=3.1415926000000000684 a.b.double=3.1415926000000000684
a.b.lange_naam=dit is nu een andere naam geworden met extra spaties aan het einde a.b.lange_naam=dit is nu een andere naam geworden met extra spaties aan het einde
Merging ParameterSet with file 'tParameterSet.in_merge' >>>
Merging ParameterSet with file 'tParameterSet.in_merge_normal'
<<<
Showing the same keys again Showing the same keys again
a.b.c=700 a.b.c=700
...@@ -56,11 +58,12 @@ Subset a.b. contains: ...@@ -56,11 +58,12 @@ Subset a.b. contains:
Trying to read a non-existing key Trying to read a non-existing key
>>> >>>
DEBUG [tParameterSet@rs002.wan.lofar]ACC.APS.EXCEPTION - Key is.er.niet unknown
<<< <<<
Told you the key didn't exist. Told you the key didn't exist.
Finally write the parameterset to 'newset.stdout' >>>
Finally write the parameterset to 'tParameterSet_tmp.newset.normal'
<<<
testing getInt32Vector testing getInt32Vector
5 elements in intVector1Dim 5 elements in intVector1Dim
...@@ -82,3 +85,90 @@ a.c.a ...@@ -82,3 +85,90 @@ a.c.a
e.g e.g
egg egg
vtest.intVector1Dim vtest.intVector1Dim
>>>
Reading in parameterfile 'tParameterSet.in_param_nocase'
<<<
Showing some values
a.b.c=5
a.b=7
a.b.double=3.1415926000000000684
a.b.lange_naam=dit is nu een andere naam geworden met extra spaties aan het einde
>>>
Merging ParameterSet with file 'tParameterSet.in_merge_nocase'
<<<
Showing the same keys again
a.b.c=700
a.b=0
a.b.double=3.141592653589793116
a.b.lange_naam=dit is een wat langere naam
a.b.time1=15
a.b.time2=900
a.b.time3=54000
The main ParameterSet contains:
[A.B],[0..3]
[a.B.c],[700.3]
[a.B.c.D.e.F.g.H],[tjee wat een levels!]
[a.b.DOUBLE],[3.1415926535897932384626433832795]
[a.B.lange_naam],[dit is een wat langere naam]
[A.b.time1],[15 s]
[a.B.time2],[15m]
[a.b.TIME3],[15 hour]
[A.c.a],[nog een afkorting]
[e.g],[een voorbeeld]
[Egg],[een ei]
[VTest.IntVector1Dim],[[ 3, "20485", 002, '4904' , 25 ]]
Fullname of 'b'=a.
isValidVersionNr(1.2.3.4) = 0
isValidVersionNr(1.2.3) = 1
isValidVersionNr(1.2) = 0
isValidVersionNr(stable) = 0
isValidVersionNrRef(1.2.3) = 1
isValidVersionNrRef(1.2) = 0
isValidVersionNrRef(stable) = 1
isValidVersionNrRef(error) = 0
isValidVersionNrRef(1.2.3.AndALotOfGarbageBehindTheLastNumberPart) = 0
Creating a subset 'a.b.'
Subset a.b. contains:
[c],[700.3]
[c.D.e.F.g.H],[tjee wat een levels!]
[DOUBLE],[3.1415926535897932384626433832795]
[lange_naam],[dit is een wat langere naam]
[time1],[15 s]
[time2],[15m]
[TIME3],[15 hour]
Trying to read a non-existing key
>>>
<<<
Told you the key didn't exist.
>>>
Finally write the parameterset to 'tParameterSet_tmp.newset.nocase'
<<<
testing getInt32Vector
5 elements in intVector1Dim
3,20485,2,4904,25,
trying to read single int as vector
1 elements in a.b.c
700,
Iterate over all keys ...
A.B
a.B.c
a.B.c.D.e.F.g.H
a.b.DOUBLE
a.B.lange_naam
A.b.time1
a.B.time2
a.b.TIME3
A.c.a
e.g
Egg
VTest.IntVector1Dim
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment