Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippGetMachineClassResponse.cpp

Go to the documentation of this file.
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 #include "ippdme/Response/ippGetMachineClassResponse.h"
00013 #include "ippdme/misc/ippStringBuilder.h"
00014 
00015 
00016 ippGetMachineClassResponse::ippGetMachineClassResponse(
00017  unsigned int inTagNumber
00018 )
00019   : ippResponse(inTagNumber, CommandTag, DataGetMachineClass) 
00020 {
00021   setMachineClass(CartCMM);
00022 }
00023 
00024 ippGetMachineClassResponse::ippGetMachineClassResponse(
00025   unsigned int inTagNumber,
00026   ippMachineClassType inMachineClass
00027 )
00028   : ippResponse(inTagNumber, CommandTag, DataGetMachineClass)
00029 {
00030   setMachineClass(inMachineClass);
00031 }
00032 
00033 ippMachineClassType ippGetMachineClassResponse::getMachineClass()const
00034 {
00035   return _machineClass; 
00036 }
00037 
00038 void ippGetMachineClassResponse::setMachineClass(ippMachineClassType inMachineClass)
00039 {
00040   _machineClass = inMachineClass;
00041 }
00042 
00043 
00044 #define MACHINECLASS_ENUMERATION                           \
00045   ENUM( CartCMM , "CartCMM")                               \
00046   ENUM( CartCMMWithRotaryTable , "CartCMMWithRotaryTable") \
00047 
00048 const char* toString(ippMachineClassType machineClass)
00049 {
00050   switch(machineClass) {
00051 #define ENUM(value,strValue) case value: return strValue;
00052     MACHINECLASS_ENUMERATION
00053 #undef ENUM
00054   }
00055   return "";
00056 }
00057 ippMachineClassType fromString(const std::string& s)
00058 {
00059 #define ENUM(value,strValue) if (s ==strValue ) return value;
00060   MACHINECLASS_ENUMERATION
00061 #undef ENUM
00062   return ippMachineClassType_INVALID;
00063 }
00064 
00065 ippMachineClassType MachineClassTypeFromKeyWord(ippOtherKeyType keyword )
00066 {
00067 #define ENUM(value,strValue) if (keyword ==value ) return value;
00068    MACHINECLASS_ENUMERATION
00069 #undef ENUM
00070   return ippMachineClassType_INVALID;
00071 }
00072 
00073 std::string ippGetMachineClassResponse::getResponseString() const
00074 {  
00075   return ippStringBuilder(_tag,"#").AppendFunc("GetMachineClass",_machineClass).ToString();
00076 }
00077 

Generated on Wed Nov 8 00:20:06 2006 for IPPDME by  doxygen 1.4.1