&{${CLASS}${METHOD}Body.h}
/*
 *
 * Copyright (c) 2006 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/*
 * This file is auto-generated by ${GENERATOR} - do not modify.
 * Supported AMQP versions:
%{VLIST} *   ${major}-${minor}
 */

#include <map>
#include <string>
#include <sstream>

#include "qpid/framing/amqp_types.h"
#include "AMQP_ServerOperations.h"
#include "qpid/framing/AMQMethodBody.h"
#include "qpid/framing/Buffer.h"
#include "qpid/framing/FieldTable.h"

#ifndef _${CLASS}${METHOD}Body_
#define _${CLASS}${METHOD}Body_

namespace qpid
{
namespace framing
{
${version_namespace_start}
 
class ${CLASS}${METHOD}Body : virtual public AMQMethodBody
{
	const int classId = ${CLASS_ID_INIT};
	const int methodId = ${METHOD_ID_INIT};
	
	// Method field declarations

%{FLIST} ${mb_field_declaration}
     

public:
    typedef std::tr1::shared_ptr<${CLASS}${METHOD}Body> shared_ptr;

	// Constructors and destructors
	
    inline ${CLASS}${METHOD}Body(
%{FLIST} ${mb_field_list_declare}
	) :
%{FLIST} ${mb_field_list_initializer}
    {}

    inline ${CLASS}${METHOD}Body() {}

	${CLASS}${METHOD}Body() {}
	
    virtual ~${CLASS}${METHOD}Body() {}
    
    // Attribute get methods

%{FLIST} ${mb_field_get_method}

    // Helper methods
    
    inline void print(std::ostream& out) const
    {
	    out << "${CLASS}${METHOD}: ";
%{FLIST} ${mb_field_print}
    }

    inline u_int16_t amqpClassId() const
    {
    	return classId;
    }
    
    inline u_int16_t amqpMethodId() const
    {
    	return methodId;
    }

    inline u_int32_t bodySize() const
    {
		u_int32_t size = 0;        
%{FLIST} ${mb_body_size}
        return size;
    }

    inline void encodeContent(Buffer& buffer) const
    {
%{FLIST} ${mb_encode}
    }

    inline void decodeContent(Buffer& buffer)
    {
%{FLIST} ${mb_decode}
    }       

    inline void invoke(AMQP_ServerOperations& target, u_int16_t channel)
    {
		target.getBasicHandler()->consume(
%{FLIST} ${mb_field_list}
		);
    }
}; // class ${CLASS}${METHOD}Body

${version_namespace_end}
} // namespace framing
} // namespace qpid

#endif

