//
// Generated file, do not edit! Created by opp_msgc 4.2 from src/node/application/wiseCameraDPF/WiseCameraDPFMessage.msg.
//

// Disable warnings about unused variables, empty switch stmts, etc:
#ifdef _MSC_VER
#  pragma warning(disable:4101)
#  pragma warning(disable:4065)
#endif

#include <iostream>
#include <sstream>
#include "WiseCameraDPFMessage_m.h"

// Template rule which fires if a struct or class doesn't have operator<<
template<typename T>
std::ostream& operator<<(std::ostream& out,const T&) {return out;}

// Another default rule (prevents compiler from choosing base class' doPacking())
template<typename T>
void doPacking(cCommBuffer *, T& t) {
    throw cRuntimeError("Parsim error: no doPacking() function for type %s or its base class (check .msg and _m.cc/h files!)",opp_typename(typeid(t)));
}

template<typename T>
void doUnpacking(cCommBuffer *, T& t) {
    throw cRuntimeError("Parsim error: no doUnpacking() function for type %s or its base class (check .msg and _m.cc/h files!)",opp_typename(typeid(t)));
}




WiseCameraDPFMessage_Base::WiseCameraDPFMessage_Base(const char *name, int kind) : WiseApplicationPacket(name,kind)
{
    this->targetID_var = 0;
    this->trackingStep_var = 0;
    this->aggregationStep_var = 0;
    this->detectionMiss_var = 0;
    this->firstStepFailed_var = 0;
    this->targetLost_var = 0;
    this->firstNodeSelection_var = 0;
    this->firstNodeSelectionScore_var = 0;
    this->firstNodeSelectionCompleted_var = 0;
    this->firstStartTime_var = 0;
    this->veryFirstStartTime_var = 0;
    this->useGmm_var = 0;
    this->fakeVoidPointer_var = 0;
}

WiseCameraDPFMessage_Base::WiseCameraDPFMessage_Base(const WiseCameraDPFMessage_Base& other) : WiseApplicationPacket(other)
{
    copy(other);
}

WiseCameraDPFMessage_Base::~WiseCameraDPFMessage_Base()
{
}

WiseCameraDPFMessage_Base& WiseCameraDPFMessage_Base::operator=(const WiseCameraDPFMessage_Base& other)
{
    if (this==&other) return *this;
    WiseApplicationPacket::operator=(other);
    copy(other);
    return *this;
}

void WiseCameraDPFMessage_Base::copy(const WiseCameraDPFMessage_Base& other)
{
    this->targetID_var = other.targetID_var;
    this->trackingStep_var = other.trackingStep_var;
    this->aggregationStep_var = other.aggregationStep_var;
    this->detectionMiss_var = other.detectionMiss_var;
    this->firstStepFailed_var = other.firstStepFailed_var;
    this->targetLost_var = other.targetLost_var;
    this->firstNodeSelection_var = other.firstNodeSelection_var;
    this->firstNodeSelectionScore_var = other.firstNodeSelectionScore_var;
    this->firstNodeSelectionCompleted_var = other.firstNodeSelectionCompleted_var;
    this->firstStartTime_var = other.firstStartTime_var;
    this->veryFirstStartTime_var = other.veryFirstStartTime_var;
    this->useGmm_var = other.useGmm_var;
    this->fakeVoidPointer_var = other.fakeVoidPointer_var;
}

void WiseCameraDPFMessage_Base::parsimPack(cCommBuffer *b)
{
    WiseApplicationPacket::parsimPack(b);
    doPacking(b,this->targetID_var);
    doPacking(b,this->trackingStep_var);
    doPacking(b,this->aggregationStep_var);
    doPacking(b,this->detectionMiss_var);
    doPacking(b,this->firstStepFailed_var);
    doPacking(b,this->targetLost_var);
    doPacking(b,this->firstNodeSelection_var);
    doPacking(b,this->firstNodeSelectionScore_var);
    doPacking(b,this->firstNodeSelectionCompleted_var);
    doPacking(b,this->firstStartTime_var);
    doPacking(b,this->veryFirstStartTime_var);
    doPacking(b,this->useGmm_var);
    doPacking(b,this->fakeVoidPointer_var);
    // field gmm is abstract -- please do packing in customized class
}

void WiseCameraDPFMessage_Base::parsimUnpack(cCommBuffer *b)
{
    WiseApplicationPacket::parsimUnpack(b);
    doUnpacking(b,this->targetID_var);
    doUnpacking(b,this->trackingStep_var);
    doUnpacking(b,this->aggregationStep_var);
    doUnpacking(b,this->detectionMiss_var);
    doUnpacking(b,this->firstStepFailed_var);
    doUnpacking(b,this->targetLost_var);
    doUnpacking(b,this->firstNodeSelection_var);
    doUnpacking(b,this->firstNodeSelectionScore_var);
    doUnpacking(b,this->firstNodeSelectionCompleted_var);
    doUnpacking(b,this->firstStartTime_var);
    doUnpacking(b,this->veryFirstStartTime_var);
    doUnpacking(b,this->useGmm_var);
    doUnpacking(b,this->fakeVoidPointer_var);
    // field gmm is abstract -- please do unpacking in customized class
}

unsigned int WiseCameraDPFMessage_Base::getTargetID() const
{
    return targetID_var;
}

void WiseCameraDPFMessage_Base::setTargetID(unsigned int targetID)
{
    this->targetID_var = targetID;
}

unsigned long WiseCameraDPFMessage_Base::getTrackingStep() const
{
    return trackingStep_var;
}

void WiseCameraDPFMessage_Base::setTrackingStep(unsigned long trackingStep)
{
    this->trackingStep_var = trackingStep;
}

unsigned int WiseCameraDPFMessage_Base::getAggregationStep() const
{
    return aggregationStep_var;
}

void WiseCameraDPFMessage_Base::setAggregationStep(unsigned int aggregationStep)
{
    this->aggregationStep_var = aggregationStep;
}

bool WiseCameraDPFMessage_Base::getDetectionMiss() const
{
    return detectionMiss_var;
}

void WiseCameraDPFMessage_Base::setDetectionMiss(bool detectionMiss)
{
    this->detectionMiss_var = detectionMiss;
}

bool WiseCameraDPFMessage_Base::getFirstStepFailed() const
{
    return firstStepFailed_var;
}

void WiseCameraDPFMessage_Base::setFirstStepFailed(bool firstStepFailed)
{
    this->firstStepFailed_var = firstStepFailed;
}

bool WiseCameraDPFMessage_Base::getTargetLost() const
{
    return targetLost_var;
}

void WiseCameraDPFMessage_Base::setTargetLost(bool targetLost)
{
    this->targetLost_var = targetLost;
}

bool WiseCameraDPFMessage_Base::getFirstNodeSelection() const
{
    return firstNodeSelection_var;
}

void WiseCameraDPFMessage_Base::setFirstNodeSelection(bool firstNodeSelection)
{
    this->firstNodeSelection_var = firstNodeSelection;
}

double WiseCameraDPFMessage_Base::getFirstNodeSelectionScore() const
{
    return firstNodeSelectionScore_var;
}

void WiseCameraDPFMessage_Base::setFirstNodeSelectionScore(double firstNodeSelectionScore)
{
    this->firstNodeSelectionScore_var = firstNodeSelectionScore;
}

bool WiseCameraDPFMessage_Base::getFirstNodeSelectionCompleted() const
{
    return firstNodeSelectionCompleted_var;
}

void WiseCameraDPFMessage_Base::setFirstNodeSelectionCompleted(bool firstNodeSelectionCompleted)
{
    this->firstNodeSelectionCompleted_var = firstNodeSelectionCompleted;
}

double WiseCameraDPFMessage_Base::getFirstStartTime() const
{
    return firstStartTime_var;
}

void WiseCameraDPFMessage_Base::setFirstStartTime(double firstStartTime)
{
    this->firstStartTime_var = firstStartTime;
}

double WiseCameraDPFMessage_Base::getVeryFirstStartTime() const
{
    return veryFirstStartTime_var;
}

void WiseCameraDPFMessage_Base::setVeryFirstStartTime(double veryFirstStartTime)
{
    this->veryFirstStartTime_var = veryFirstStartTime;
}

bool WiseCameraDPFMessage_Base::getUseGmm() const
{
    return useGmm_var;
}

void WiseCameraDPFMessage_Base::setUseGmm(bool useGmm)
{
    this->useGmm_var = useGmm;
}

unsigned long WiseCameraDPFMessage_Base::getFakeVoidPointer() const
{
    return fakeVoidPointer_var;
}

void WiseCameraDPFMessage_Base::setFakeVoidPointer(unsigned long fakeVoidPointer)
{
    this->fakeVoidPointer_var = fakeVoidPointer;
}

class WiseCameraDPFMessageDescriptor : public cClassDescriptor
{
  public:
    WiseCameraDPFMessageDescriptor();
    virtual ~WiseCameraDPFMessageDescriptor();

    virtual bool doesSupport(cObject *obj) const;
    virtual const char *getProperty(const char *propertyname) const;
    virtual int getFieldCount(void *object) const;
    virtual const char *getFieldName(void *object, int field) const;
    virtual int findField(void *object, const char *fieldName) const;
    virtual unsigned int getFieldTypeFlags(void *object, int field) const;
    virtual const char *getFieldTypeString(void *object, int field) const;
    virtual const char *getFieldProperty(void *object, int field, const char *propertyname) const;
    virtual int getArraySize(void *object, int field) const;

    virtual std::string getFieldAsString(void *object, int field, int i) const;
    virtual bool setFieldAsString(void *object, int field, int i, const char *value) const;

    virtual const char *getFieldStructName(void *object, int field) const;
    virtual void *getFieldStructPointer(void *object, int field, int i) const;
};

Register_ClassDescriptor(WiseCameraDPFMessageDescriptor);

WiseCameraDPFMessageDescriptor::WiseCameraDPFMessageDescriptor() : cClassDescriptor("WiseCameraDPFMessage", "WiseApplicationPacket")
{
}

WiseCameraDPFMessageDescriptor::~WiseCameraDPFMessageDescriptor()
{
}

bool WiseCameraDPFMessageDescriptor::doesSupport(cObject *obj) const
{
    return dynamic_cast<WiseCameraDPFMessage_Base *>(obj)!=NULL;
}

const char *WiseCameraDPFMessageDescriptor::getProperty(const char *propertyname) const
{
    if (!strcmp(propertyname,"customize")) return "true";
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    return basedesc ? basedesc->getProperty(propertyname) : NULL;
}

int WiseCameraDPFMessageDescriptor::getFieldCount(void *object) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    return basedesc ? 14+basedesc->getFieldCount(object) : 14;
}

unsigned int WiseCameraDPFMessageDescriptor::getFieldTypeFlags(void *object, int field) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldTypeFlags(object, field);
        field -= basedesc->getFieldCount(object);
    }
    static unsigned int fieldTypeFlags[] = {
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISEDITABLE,
        FD_ISARRAY | FD_ISCOMPOUND,
    };
    return (field>=0 && field<14) ? fieldTypeFlags[field] : 0;
}

const char *WiseCameraDPFMessageDescriptor::getFieldName(void *object, int field) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldName(object, field);
        field -= basedesc->getFieldCount(object);
    }
    static const char *fieldNames[] = {
        "targetID",
        "trackingStep",
        "aggregationStep",
        "detectionMiss",
        "firstStepFailed",
        "targetLost",
        "firstNodeSelection",
        "firstNodeSelectionScore",
        "firstNodeSelectionCompleted",
        "firstStartTime",
        "veryFirstStartTime",
        "useGmm",
        "fakeVoidPointer",
        "gmm",
    };
    return (field>=0 && field<14) ? fieldNames[field] : NULL;
}

int WiseCameraDPFMessageDescriptor::findField(void *object, const char *fieldName) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    int base = basedesc ? basedesc->getFieldCount(object) : 0;
    if (fieldName[0]=='t' && strcmp(fieldName, "targetID")==0) return base+0;
    if (fieldName[0]=='t' && strcmp(fieldName, "trackingStep")==0) return base+1;
    if (fieldName[0]=='a' && strcmp(fieldName, "aggregationStep")==0) return base+2;
    if (fieldName[0]=='d' && strcmp(fieldName, "detectionMiss")==0) return base+3;
    if (fieldName[0]=='f' && strcmp(fieldName, "firstStepFailed")==0) return base+4;
    if (fieldName[0]=='t' && strcmp(fieldName, "targetLost")==0) return base+5;
    if (fieldName[0]=='f' && strcmp(fieldName, "firstNodeSelection")==0) return base+6;
    if (fieldName[0]=='f' && strcmp(fieldName, "firstNodeSelectionScore")==0) return base+7;
    if (fieldName[0]=='f' && strcmp(fieldName, "firstNodeSelectionCompleted")==0) return base+8;
    if (fieldName[0]=='f' && strcmp(fieldName, "firstStartTime")==0) return base+9;
    if (fieldName[0]=='v' && strcmp(fieldName, "veryFirstStartTime")==0) return base+10;
    if (fieldName[0]=='u' && strcmp(fieldName, "useGmm")==0) return base+11;
    if (fieldName[0]=='f' && strcmp(fieldName, "fakeVoidPointer")==0) return base+12;
    if (fieldName[0]=='g' && strcmp(fieldName, "gmm")==0) return base+13;
    return basedesc ? basedesc->findField(object, fieldName) : -1;
}

const char *WiseCameraDPFMessageDescriptor::getFieldTypeString(void *object, int field) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldTypeString(object, field);
        field -= basedesc->getFieldCount(object);
    }
    static const char *fieldTypeStrings[] = {
        "unsigned int",
        "unsigned long",
        "unsigned int",
        "bool",
        "bool",
        "bool",
        "bool",
        "double",
        "bool",
        "double",
        "double",
        "bool",
        "unsigned long",
        "WiseUtils::Gmm::Component",
    };
    return (field>=0 && field<14) ? fieldTypeStrings[field] : NULL;
}

const char *WiseCameraDPFMessageDescriptor::getFieldProperty(void *object, int field, const char *propertyname) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldProperty(object, field, propertyname);
        field -= basedesc->getFieldCount(object);
    }
    switch (field) {
        default: return NULL;
    }
}

int WiseCameraDPFMessageDescriptor::getArraySize(void *object, int field) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getArraySize(object, field);
        field -= basedesc->getFieldCount(object);
    }
    WiseCameraDPFMessage_Base *pp = (WiseCameraDPFMessage_Base *)object; (void)pp;
    switch (field) {
        case 13: return pp->getGmmArraySize();
        default: return 0;
    }
}

std::string WiseCameraDPFMessageDescriptor::getFieldAsString(void *object, int field, int i) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldAsString(object,field,i);
        field -= basedesc->getFieldCount(object);
    }
    WiseCameraDPFMessage_Base *pp = (WiseCameraDPFMessage_Base *)object; (void)pp;
    switch (field) {
        case 0: return ulong2string(pp->getTargetID());
        case 1: return ulong2string(pp->getTrackingStep());
        case 2: return ulong2string(pp->getAggregationStep());
        case 3: return bool2string(pp->getDetectionMiss());
        case 4: return bool2string(pp->getFirstStepFailed());
        case 5: return bool2string(pp->getTargetLost());
        case 6: return bool2string(pp->getFirstNodeSelection());
        case 7: return double2string(pp->getFirstNodeSelectionScore());
        case 8: return bool2string(pp->getFirstNodeSelectionCompleted());
        case 9: return double2string(pp->getFirstStartTime());
        case 10: return double2string(pp->getVeryFirstStartTime());
        case 11: return bool2string(pp->getUseGmm());
        case 12: return ulong2string(pp->getFakeVoidPointer());
        case 13: {std::stringstream out; out << pp->getGmm(i); return out.str();}
        default: return "";
    }
}

bool WiseCameraDPFMessageDescriptor::setFieldAsString(void *object, int field, int i, const char *value) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->setFieldAsString(object,field,i,value);
        field -= basedesc->getFieldCount(object);
    }
    WiseCameraDPFMessage_Base *pp = (WiseCameraDPFMessage_Base *)object; (void)pp;
    switch (field) {
        case 0: pp->setTargetID(string2ulong(value)); return true;
        case 1: pp->setTrackingStep(string2ulong(value)); return true;
        case 2: pp->setAggregationStep(string2ulong(value)); return true;
        case 3: pp->setDetectionMiss(string2bool(value)); return true;
        case 4: pp->setFirstStepFailed(string2bool(value)); return true;
        case 5: pp->setTargetLost(string2bool(value)); return true;
        case 6: pp->setFirstNodeSelection(string2bool(value)); return true;
        case 7: pp->setFirstNodeSelectionScore(string2double(value)); return true;
        case 8: pp->setFirstNodeSelectionCompleted(string2bool(value)); return true;
        case 9: pp->setFirstStartTime(string2double(value)); return true;
        case 10: pp->setVeryFirstStartTime(string2double(value)); return true;
        case 11: pp->setUseGmm(string2bool(value)); return true;
        case 12: pp->setFakeVoidPointer(string2ulong(value)); return true;
        default: return false;
    }
}

const char *WiseCameraDPFMessageDescriptor::getFieldStructName(void *object, int field) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldStructName(object, field);
        field -= basedesc->getFieldCount(object);
    }
    static const char *fieldStructNames[] = {
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        NULL,
        "WiseUtils::Gmm::Component",
    };
    return (field>=0 && field<14) ? fieldStructNames[field] : NULL;
}

void *WiseCameraDPFMessageDescriptor::getFieldStructPointer(void *object, int field, int i) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    if (basedesc) {
        if (field < basedesc->getFieldCount(object))
            return basedesc->getFieldStructPointer(object, field, i);
        field -= basedesc->getFieldCount(object);
    }
    WiseCameraDPFMessage_Base *pp = (WiseCameraDPFMessage_Base *)object; (void)pp;
    switch (field) {
        case 13: return (void *)(&pp->getGmm(i)); break;
        default: return NULL;
    }
}


