85 out <<
object.getInt() <<
" " <<
object.getString();
91 std::string theString;
94 object.setInt(theInt);
95 object.setString(theString);
107int main(
int argc,
char* argv[])
115 bool success =
false;
123 myPL.
set<
int>(
"my int", 1);
124 myPL.
set<
unsigned int>(
"my unsigned int", 1);
125 myPL.
set<
short int>(
"my short int", 1);
126 myPL.
set<
short>(
"my short", 1);
127 myPL.
set<
unsigned short int>(
"my unsigned short int", 1);
128 myPL.
set<
unsigned short>(
"my unsigned short", 1);
129 myPL.
set<
long int>(
"my long int", 1);
130 myPL.
set<
long>(
"my long", 1);
131 myPL.
set<
unsigned long int>(
"my unsigned long int", 1);
132 myPL.
set<
unsigned long>(
"my unsigned long", 1);
133 myPL.
set<
long long int>(
"my long long int", 1);
134 myPL.
set<
long long>(
"my long long", 1);
135 myPL.
set<
unsigned long long int>(
"my unsigned long long int", 1);
136 myPL.
set<
unsigned long long>(
"my unsigned long long", 1);
137 myPL.
set<
float>(
"my float", 4.3);
138 myPL.
set<
double>(
"my double", 4.3);
139 myPL.
set(
"my string",
"hello");
140 myPL.
set(
"my char",
'c');
141 myPL.
set(
"my bool",
true);
146 tuple<unsigned int>(1));
148 tuple<short int>(1, 2));
150 tuple<unsigned short int>(1, 2));
152 tuple<long int>(1, 2));
154 tuple<unsigned long int>(1, 2));
156 tuple<long long int>(1, 2));
158 tuple<unsigned long long>(1, 2));
162 tuple<std::string>(
"hello",
"world"));
167 myPL.
set(
"my custom data", sampleCustom);
189 std::cout << *readPL;
193 std::cout <<
"Huzzah!\n";
198 const int myInt = readPL->
get<
int>(
"my int");
199 std::cout <<
"myInt = " << myInt <<
"\n";
200 const unsigned int myUnsignedInt = readPL->
get<
unsigned int>(
"my unsigned int");
201 std::cout <<
"myUnsignedInt = " << myUnsignedInt <<
"\n";
202 const short int myShortInt = readPL->
get<
short int>(
"my short int");
203 std::cout <<
"myShortInt = " << myShortInt <<
"\n";
204 const short int myShort = readPL->
get<
short>(
"my short");
205 std::cout <<
"myShort = " << myShort <<
"\n";
206 const unsigned short int myUnsignedShortInt = readPL->
get<
unsigned short int>(
"my unsigned short int");
207 std::cout <<
"myUnsignedShortInt = " << myUnsignedShortInt <<
"\n";
208 const unsigned short int myUnsignedShort = readPL->
get<
unsigned short>(
"my unsigned short");
209 std::cout <<
"myUnsignedShort = " << myUnsignedShort <<
"\n";
210 const long int myLongInt = readPL->
get<
long int>(
"my long int");
211 std::cout <<
"myLongInt = " << myLongInt <<
"\n";
212 const long int myLong = readPL->
get<
long>(
"my long");
213 std::cout <<
"myLong = " << myLong <<
"\n";
214 const unsigned long int myUnsignedLongInt = readPL->
get<
unsigned long int>(
"my unsigned long int");
215 std::cout <<
"myUnsignedLongInt = " << myUnsignedLongInt <<
"\n";
216 const unsigned long myUnsignedLong = readPL->
get<
unsigned long>(
"my unsigned long");
217 std::cout <<
"myUnsignedLong = " << myUnsignedLong <<
"\n";
218 const long long int myLongLongInt = readPL->
get<
long long int>(
"my long long int");
219 std::cout <<
"myLongLongInt = " << myLongLongInt <<
"\n";
220 const long long int myLongLong = readPL->
get<
long long>(
"my long long");
221 std::cout <<
"myLongLong = " << myLongLong <<
"\n";
222 const unsigned long long int myUnsignedLongLongInt = readPL->
get<
unsigned long long int>(
"my unsigned long long int");
223 std::cout <<
"myUnsignedLongLongInt = " << myUnsignedLongLongInt <<
"\n";
224 const unsigned long long myUnsignedLongLong = readPL->
get<
unsigned long long>(
"my unsigned long long");
225 std::cout <<
"myUnsignedLongLong = " << myUnsignedLongLong <<
"\n";
226 const float myFloat = readPL->
get<
float>(
"my float");
227 std::cout <<
"myFloat = " << myFloat <<
"\n";
228 const double myDouble = readPL->
get<
double>(
"my double");
229 std::cout <<
"myDouble = " << myDouble <<
"\n";
230 const std::string myString = readPL->
get<std::string>(
"my string");
231 std::cout <<
"myString = " << myString <<
"\n";
232 const char myChar = readPL->
get<
char>(
"my char");
233 std::cout <<
"myChar = " << myChar <<
"\n";
234 const bool myBool = readPL->
get<
bool>(
"my bool");
235 std::cout <<
"myBool = " << myBool <<
"\n";
237 std::cout <<
"myIntArray = " << myIntArray <<
"\n";
239 std::cout <<
"myFloatArray = " << myFloatArray <<
"\n";
241 std::cout <<
"myDoubleArray = " << myDoubleArray <<
"\n";
243 std::cout <<
"myStringArray = " << myStringArray <<
"\n";
254 return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
Templated array class derived from the STL std::vector.
#define TEUCHOS_ADD_TYPE_CONVERTER(T)
Templated Parameter List class.
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
Simple macro that catches and reports standard exceptions and other exceptions.
Simple helper functions that make it easy to read and write XML to and from a parameterlist.
Definition of Teuchos::as, for conversions between types.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
void setString(std::string theString)
std::string getString() const
bool operator==(const CustomDataType &other) const
CustomDataType(int theInt, std::string theString)
A list of parameters of arbitrary type.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Set a parameter whose value has type T.
Smart reference counting pointer class for automatic garbage collection.
T * get() const
Get the raw C++ pointer to the underlying object.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
A list of parameters of arbitrary type.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void writeParameterListToXmlOStream(const ParameterList ¶mList, std::ostream &xmlOut, RCP< const DependencySheet > depSheet=null)
Write parameters and sublists in XML format to an std::ostream.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void writeParameterListToXmlFile(const ParameterList ¶mList, const std::string &xmlFileName, RCP< const DependencySheet > depSheet=null)
Write parameters and sublist to an XML file.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > getParametersFromXmlFile(const std::string &xmlFileName)
Reads XML parameters from a file and return them in a new parameter list.
Smart reference counting pointer class for automatic garbage collection.
Tuple< T, 1 > tuple(const T &a)
Create a Tuple<T,1>.
std::string Teuchos_Version()
std::ostream & operator<<(std::ostream &out, const CustomDataType &object)
std::istream & operator>>(std::istream &in, CustomDataType &object)