OpenTTCN/Knowledge base/Writing Custom Codec Component/CodecComponentImpl.h

From OpenTTCN

Jump to: navigation, search

  OpenTTCN DocZone

  Home | Developer's corner | Knowledge base | Working documents | Documentation | OpenTTCN IDE | Tutorials | Training | How do I | Frequently asked questions | Technical support


CodecComponentImpl.h


Back to main article >>

#ifndef _SOME_APP_CODEC_COMPONENT_IMPL_H_GUARD_
#define _SOME_APP_CODEC_COMPONENT_IMPL_H_GUARD_

#include <CodecComponent.h>

#include <util/EncodeBuffer.h>
#include <util/DecodeBuffer.h>

#include <string>
#include <memory>

namespace some_app_codec_component {

class CodecComponentImpl : public OpenTTCN::SDK::CodecComponent
{
private:

    std::auto_ptr<OpenTTCN::SDK::Util::EncodeBuffer> _encBuffer;
    std::auto_ptr<OpenTTCN::SDK::Util::DecodeBuffer> _decBuffer;

public:

    static CodecComponent* create();

    CodecComponentImpl();

    virtual ~CodecComponentImpl();

    virtual std::string getComponentName();

    virtual std::string getComponentVersion();

    virtual void setProperty(
        const std::string& name, void* value);

    virtual ORG_ETSI_TTCN3_TRI::TriMessage* encode(
        const ORG_ETSI_TTCN3_TCI::TciValue* value);

    virtual ORG_ETSI_TTCN3_TCI::TciValue* decode(
        const ORG_ETSI_TTCN3_TRI::TriMessage* message,
        const ORG_ETSI_TTCN3_TCI::TciType* decodingHypothesis);
};

} // ns some_app_codec_component

#endif
Views
Personal tools