#ifndef __MYSQL_ROUTINE_GROUP_EDITOR_H__
#define __MYSQL_ROUTINE_GROUP_EDITOR_H__

#include "mysql_routinegroup_editor.h"
#include "GrtTemplates.h"
#include "grtdb/db_object_helpers.h"

#ifdef _MSC_VER
//#include  <vcclr.h> // .net interop helpers
//using namespace MySQL::Grt;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Runtime::InteropServices;
#endif

namespace MySQL {
namespace Grt {
namespace Db {

public ref class MySQLRoutineGroupEditorBE : public RoutineGroupEditorBE
{
protected:
  MySQLRoutineGroupEditorBE(::MySQLRoutineGroupEditorBE *inn)
    : RoutineGroupEditorBE(inn)
  {}

public:
  MySQLRoutineGroupEditorBE(MySQL::Grt::GrtManager^ grtm, MySQL::Grt::GrtValue^ arglist)
    : RoutineGroupEditorBE(
        new ::MySQLRoutineGroupEditorBE(grtm->get_unmanaged_object(), 
        db_mysql_RoutineGroupRef::cast_from(grt::BaseListRef::cast_from(arglist->get_unmanaged_object()).get(0)), 
        get_rdbms_for_db_object(grt::BaseListRef::cast_from(arglist->get_unmanaged_object()).get(0))
        )
      )
  {
  }

  ::MySQLRoutineGroupEditorBE *get_unmanaged_object()
  { return static_cast<::MySQLRoutineGroupEditorBE *>(inner); }
  
  String^ get_procedure_body()
  { return CppStringToNative(get_unmanaged_object()->get_procedure_body()); }

  String^ get_function_body()
  { return CppStringToNative(get_unmanaged_object()->get_function_body()); }
};

} // namespace Db
} // namespace Grt
} // namespace MySQL

#endif // __MYSQL_ROUTINE_GROUP_EDITOR_H__