//
// Generated file, do not edit! Created by opp_msgc 4.1 from src/world/physicalProcess/wiseVideoFile/WiseVideoFileMessage.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 "WiseVideoFileMessage_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)));
}




Register_Class(WiseVideoFileMessage);

WiseVideoFileMessage::WiseVideoFileMessage(const char *name, int kind) : WisePhysicalProcessMessage(name,kind)
{
    this->valid_var = 0;
    this->fileName_var = 0;
    this->frameRate_var = 0;
}

WiseVideoFileMessage::WiseVideoFileMessage(const WiseVideoFileMessage& other) : WisePhysicalProcessMessage()
{
    setName(other.getName());
    operator=(other);
}

WiseVideoFileMessage::~WiseVideoFileMessage()
{
}

WiseVideoFileMessage& WiseVideoFileMessage::operator=(const WiseVideoFileMessage& other)
{
    if (this==&other) return *this;
    WisePhysicalProcessMessage::operator=(other);
    this->valid_var = other.valid_var;
    this->fileName_var = other.fileName_var;
    this->frameRate_var = other.frameRate_var;
    return *this;
}

void WiseVideoFileMessage::parsimPack(cCommBuffer *b)
{
    WisePhysicalProcessMessage::parsimPack(b);
    doPacking(b,this->valid_var);
    doPacking(b,this->fileName_var);
    doPacking(b,this->frameRate_var);
}

void WiseVideoFileMessage::parsimUnpack(cCommBuffer *b)
{
    WisePhysicalProcessMessage::parsimUnpack(b);
    doUnpacking(b,this->valid_var);
    doUnpacking(b,this->fileName_var);
    doUnpacking(b,this->frameRate_var);
}

bool WiseVideoFileMessage::getValid() const
{
    return valid_var;
}

void WiseVideoFileMessage::setValid(bool valid_var)
{
    this->valid_var = valid_var;
}

const char * WiseVideoFileMessage::getFileName() const
{
    return fileName_var.c_str();
}

void WiseVideoFileMessage::setFileName(const char * fileName_var)
{
    this->fileName_var = fileName_var;
}

double WiseVideoFileMessage::getFrameRate() const
{
    return frameRate_var;
}

void WiseVideoFileMessage::setFrameRate(double frameRate_var)
{
    this->frameRate_var = frameRate_var;
}

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

    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(WiseVideoFileMessageDescriptor);

WiseVideoFileMessageDescriptor::WiseVideoFileMessageDescriptor() : cClassDescriptor("WiseVideoFileMessage", "WisePhysicalProcessMessage")
{
}

WiseVideoFileMessageDescriptor::~WiseVideoFileMessageDescriptor()
{
}

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

const char *WiseVideoFileMessageDescriptor::getProperty(const char *propertyname) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    return basedesc ? basedesc->getProperty(propertyname) : NULL;
}

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

unsigned int WiseVideoFileMessageDescriptor::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,
    };
    return (field>=0 && field<3) ? fieldTypeFlags[field] : 0;
}

const char *WiseVideoFileMessageDescriptor::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[] = {
        "valid",
        "fileName",
        "frameRate",
    };
    return (field>=0 && field<3) ? fieldNames[field] : NULL;
}

int WiseVideoFileMessageDescriptor::findField(void *object, const char *fieldName) const
{
    cClassDescriptor *basedesc = getBaseClassDescriptor();
    int base = basedesc ? basedesc->getFieldCount(object) : 0;
    if (fieldName[0]=='v' && strcmp(fieldName, "valid")==0) return base+0;
    if (fieldName[0]=='f' && strcmp(fieldName, "fileName")==0) return base+1;
    if (fieldName[0]=='f' && strcmp(fieldName, "frameRate")==0) return base+2;
    return basedesc ? basedesc->findField(object, fieldName) : -1;
}

const char *WiseVideoFileMessageDescriptor::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[] = {
        "bool",
        "string",
        "double",
    };
    return (field>=0 && field<3) ? fieldTypeStrings[field] : NULL;
}

const char *WiseVideoFileMessageDescriptor::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 WiseVideoFileMessageDescriptor::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);
    }
    WiseVideoFileMessage *pp = (WiseVideoFileMessage *)object; (void)pp;
    switch (field) {
        default: return 0;
    }
}

std::string WiseVideoFileMessageDescriptor::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);
    }
    WiseVideoFileMessage *pp = (WiseVideoFileMessage *)object; (void)pp;
    switch (field) {
        case 0: return bool2string(pp->getValid());
        case 1: return oppstring2string(pp->getFileName());
        case 2: return double2string(pp->getFrameRate());
        default: return "";
    }
}

bool WiseVideoFileMessageDescriptor::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);
    }
    WiseVideoFileMessage *pp = (WiseVideoFileMessage *)object; (void)pp;
    switch (field) {
        case 0: pp->setValid(string2bool(value)); return true;
        case 1: pp->setFileName((value)); return true;
        case 2: pp->setFrameRate(string2double(value)); return true;
        default: return false;
    }
}

const char *WiseVideoFileMessageDescriptor::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,
    };
    return (field>=0 && field<3) ? fieldStructNames[field] : NULL;
}

void *WiseVideoFileMessageDescriptor::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);
    }
    WiseVideoFileMessage *pp = (WiseVideoFileMessage *)object; (void)pp;
    switch (field) {
        default: return NULL;
    }
}


