00001 // 00002 // DISCLAIMER: 00003 // This software was produced by the National Institute of Standards 00004 // and Technology (NIST), an agency of the U.S. government, and by statute is 00005 // not subject to copyright in the United States. Recipients of this 00006 // software assume all responsibility associated with its operation, 00007 // modification,maintenance, and subsequent redistribution. 00008 // 00009 // See NIST Administration Manual 4.09.07 b and Appendix I. 00010 // 00011 #include "stdafx.h" 00012 00013 #include "ippdme/Command/ippSetPropCommand.h" 00014 #include "ippdme/misc/ippStringBuilder.h" 00015 00016 00017 ippSetPropCommand::ippSetPropCommand(unsigned int tgNum) 00018 : ippCommand(tgNum, CommandTag, ipp::SetProp) 00019 { 00020 } 00021 00022 ippSetPropCommand::~ippSetPropCommand() 00023 { 00024 } 00025 00026 void ippSetPropCommand::addPropValue(const ippProp& prop,double value) 00027 { 00028 _props.push_back(prop); 00029 _values.push_back(value); 00030 } 00031 00032 int ippSetPropCommand::getNumberProps() const 00033 { return _props.size(); } 00034 00035 double ippSetPropCommand::getValue(int n) const 00036 { return _values[n]; } 00037 00038 const ippProp& ippSetPropCommand::getProp(int n) const 00039 { return _props[n]; } 00040 00041 00042 std::string ippSetPropCommand::getCommandString() const 00043 { 00044 ippStringBuilder builder(_tag); 00045 builder.StartFunc("SetProp"); 00046 for (int m = 0; m < getNumberProps(); m++) { 00047 builder.AppendFunc(getProp(m).toString().c_str(),getValue(m)); 00048 } 00049 builder.EndFunc(); 00050 return builder.ToString(); 00051 00052 } 00053