#ifndef __grts_structs_workbench_logical_h__
#define __grts_structs_workbench_logical_h__

#include <grtpp.h>

#ifdef _WIN32
  #pragma warning(disable: 4355) // 'this' : used in base member initizalizer list
  #ifdef GRT_STRUCTS_WORKBENCH_LOGICAL_EXPORT
  #define GRT_STRUCTS_WORKBENCH_LOGICAL_PUBLIC __declspec(dllexport)
#else
  #define GRT_STRUCTS_WORKBENCH_LOGICAL_PUBLIC __declspec(dllimport)
#endif
#else
  #define GRT_STRUCTS_WORKBENCH_LOGICAL_PUBLIC
#endif

#include <grts/structs.h>
#include <grts/structs.model.h>
#include <grts/structs.eer.h>


class workbench_logical_Connection;
typedef grt::Ref<workbench_logical_Connection> workbench_logical_ConnectionRef;
class workbench_logical_Relationship;
typedef grt::Ref<workbench_logical_Relationship> workbench_logical_RelationshipRef;
class workbench_logical_Entity;
typedef grt::Ref<workbench_logical_Entity> workbench_logical_EntityRef;
class workbench_logical_Diagram;
typedef grt::Ref<workbench_logical_Diagram> workbench_logical_DiagramRef;
class workbench_logical_Model;
typedef grt::Ref<workbench_logical_Model> workbench_logical_ModelRef;


class  workbench_logical_Connection : public model_Connection
{
  typedef model_Connection super;
public:
  workbench_logical_Connection(grt::GRT *grt, grt::MetaClass *meta=0)
  : model_Connection(grt, meta ? meta : grt->get_metaclass(static_class_name())),
     _comment(""),
     _endCaption(""),
     _endCaptionXOffs(0.0),
     _endCaptionYOffs(0.0),
     _endMany(0),
     _startCaption(""),
     _startCaptionXOffs(0.0),
     _startCaptionYOffs(0.0),
     _startMany(0)

  {
  }

  static std::string static_class_name() { return "workbench.logical.Connection"; }

  grt::StringRef comment() const { return _comment; }
  virtual void comment(const grt::StringRef &value)
  {
    grt::ValueRef ovalue(_comment);
   _comment= value;
    member_changed("comment", ovalue, value);
  }

  grt::StringRef endCaption() const { return _endCaption; }
  virtual void endCaption(const grt::StringRef &value)
  {
    grt::ValueRef ovalue(_endCaption);
   _endCaption= value;
    member_changed("endCaption", ovalue, value);
  }

  grt::DoubleRef endCaptionXOffs() const { return _endCaptionXOffs; }
  virtual void endCaptionXOffs(const grt::DoubleRef &value)
  {
    grt::ValueRef ovalue(_endCaptionXOffs);
   _endCaptionXOffs= value;
    member_changed("endCaptionXOffs", ovalue, value);
  }

  grt::DoubleRef endCaptionYOffs() const { return _endCaptionYOffs; }
  virtual void endCaptionYOffs(const grt::DoubleRef &value)
  {
    grt::ValueRef ovalue(_endCaptionYOffs);
   _endCaptionYOffs= value;
    member_changed("endCaptionYOffs", ovalue, value);
  }


  grt::IntegerRef endMany() const { return _endMany; }
  virtual void endMany(const grt::IntegerRef &value)
  {
    grt::ValueRef ovalue(_endMany);
   _endMany= value;
    member_changed("endMany", ovalue, value);
  }

  grt::StringRef startCaption() const { return _startCaption; }
  virtual void startCaption(const grt::StringRef &value)
  {
    grt::ValueRef ovalue(_startCaption);
   _startCaption= value;
    member_changed("startCaption", ovalue, value);
  }

  grt::DoubleRef startCaptionXOffs() const { return _startCaptionXOffs; }
  virtual void startCaptionXOffs(const grt::DoubleRef &value)
  {
    grt::ValueRef ovalue(_startCaptionXOffs);
   _startCaptionXOffs= value;
    member_changed("startCaptionXOffs", ovalue, value);
  }

  grt::DoubleRef startCaptionYOffs() const { return _startCaptionYOffs; }
  virtual void startCaptionYOffs(const grt::DoubleRef &value)
  {
    grt::ValueRef ovalue(_startCaptionYOffs);
   _startCaptionYOffs= value;
    member_changed("startCaptionYOffs", ovalue, value);
  }


  grt::IntegerRef startMany() const { return _startMany; }
  virtual void startMany(const grt::IntegerRef &value)
  {
    grt::ValueRef ovalue(_startMany);
   _startMany= value;
    member_changed("startMany", ovalue, value);
  }

protected:

  grt::StringRef _comment;
  grt::StringRef _endCaption;
  grt::DoubleRef _endCaptionXOffs;
  grt::DoubleRef _endCaptionYOffs;
  grt::IntegerRef _endMany;
  grt::StringRef _startCaption;
  grt::DoubleRef _startCaptionXOffs;
  grt::DoubleRef _startCaptionYOffs;
  grt::IntegerRef _startMany;
private: // wrapper methods for use by grt
  static grt::ObjectRef create(grt::GRT *grt)
  {
    return grt::ObjectRef(new workbench_logical_Connection(grt));
  }


public:
  static void grt_register(grt::GRT *grt)
  {
    grt::MetaClass *meta= grt->get_metaclass(static_class_name());
    if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
    meta->bind_allocator(&workbench_logical_Connection::create);
    {
      void (workbench_logical_Connection::*setter)(const grt::StringRef &)= &workbench_logical_Connection::comment;
      grt::StringRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::comment;
      meta->bind_member("comment", new grt::MetaClass::Property<workbench_logical_Connection,grt::StringRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::StringRef &)= &workbench_logical_Connection::endCaption;
      grt::StringRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::endCaption;
      meta->bind_member("endCaption", new grt::MetaClass::Property<workbench_logical_Connection,grt::StringRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::DoubleRef &)= &workbench_logical_Connection::endCaptionXOffs;
      grt::DoubleRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::endCaptionXOffs;
      meta->bind_member("endCaptionXOffs", new grt::MetaClass::Property<workbench_logical_Connection,grt::DoubleRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::DoubleRef &)= &workbench_logical_Connection::endCaptionYOffs;
      grt::DoubleRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::endCaptionYOffs;
      meta->bind_member("endCaptionYOffs", new grt::MetaClass::Property<workbench_logical_Connection,grt::DoubleRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const model_FigureRef &)= 0;
      model_FigureRef (workbench_logical_Connection::*getter)() const= 0;
      meta->bind_member("endFigure", new grt::MetaClass::Property<workbench_logical_Connection,model_FigureRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::IntegerRef &)= &workbench_logical_Connection::endMany;
      grt::IntegerRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::endMany;
      meta->bind_member("endMany", new grt::MetaClass::Property<workbench_logical_Connection,grt::IntegerRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::StringRef &)= &workbench_logical_Connection::startCaption;
      grt::StringRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::startCaption;
      meta->bind_member("startCaption", new grt::MetaClass::Property<workbench_logical_Connection,grt::StringRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::DoubleRef &)= &workbench_logical_Connection::startCaptionXOffs;
      grt::DoubleRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::startCaptionXOffs;
      meta->bind_member("startCaptionXOffs", new grt::MetaClass::Property<workbench_logical_Connection,grt::DoubleRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::DoubleRef &)= &workbench_logical_Connection::startCaptionYOffs;
      grt::DoubleRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::startCaptionYOffs;
      meta->bind_member("startCaptionYOffs", new grt::MetaClass::Property<workbench_logical_Connection,grt::DoubleRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const model_FigureRef &)= 0;
      model_FigureRef (workbench_logical_Connection::*getter)() const= 0;
      meta->bind_member("startFigure", new grt::MetaClass::Property<workbench_logical_Connection,model_FigureRef >(getter,setter));
    }
    {
      void (workbench_logical_Connection::*setter)(const grt::IntegerRef &)= &workbench_logical_Connection::startMany;
      grt::IntegerRef (workbench_logical_Connection::*getter)() const= &workbench_logical_Connection::startMany;
      meta->bind_member("startMany", new grt::MetaClass::Property<workbench_logical_Connection,grt::IntegerRef >(getter,setter));
    }
  }
};


class  workbench_logical_Relationship : public model_Figure
{
  typedef model_Figure super;
public:
  workbench_logical_Relationship(grt::GRT *grt, grt::MetaClass *meta=0)
  : model_Figure(grt, meta ? meta : grt->get_metaclass(static_class_name())),
     _attributesExpanded(1)

  {
  }

  static std::string static_class_name() { return "workbench.logical.Relationship"; }

  grt::IntegerRef attributesExpanded() const { return _attributesExpanded; }
  virtual void attributesExpanded(const grt::IntegerRef &value)
  {
    grt::ValueRef ovalue(_attributesExpanded);
   _attributesExpanded= value;
    member_changed("attributesExpanded", ovalue, value);
  }

  eer_RelationshipRef relationship() const { return _relationship; }
  virtual void relationship(const eer_RelationshipRef &value)
  {
    grt::ValueRef ovalue(_relationship);
   _relationship= value;
    member_changed("relationship", ovalue, value);
  }

protected:

  grt::IntegerRef _attributesExpanded;
  eer_RelationshipRef _relationship;
private: // wrapper methods for use by grt
  static grt::ObjectRef create(grt::GRT *grt)
  {
    return grt::ObjectRef(new workbench_logical_Relationship(grt));
  }


public:
  static void grt_register(grt::GRT *grt)
  {
    grt::MetaClass *meta= grt->get_metaclass(static_class_name());
    if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
    meta->bind_allocator(&workbench_logical_Relationship::create);
    {
      void (workbench_logical_Relationship::*setter)(const grt::IntegerRef &)= &workbench_logical_Relationship::attributesExpanded;
      grt::IntegerRef (workbench_logical_Relationship::*getter)() const= &workbench_logical_Relationship::attributesExpanded;
      meta->bind_member("attributesExpanded", new grt::MetaClass::Property<workbench_logical_Relationship,grt::IntegerRef >(getter,setter));
    }
    {
      void (workbench_logical_Relationship::*setter)(const eer_RelationshipRef &)= &workbench_logical_Relationship::relationship;
      eer_RelationshipRef (workbench_logical_Relationship::*getter)() const= &workbench_logical_Relationship::relationship;
      meta->bind_member("relationship", new grt::MetaClass::Property<workbench_logical_Relationship,eer_RelationshipRef >(getter,setter));
    }
  }
};


class  workbench_logical_Entity : public model_Figure
{
  typedef model_Figure super;
public:
  workbench_logical_Entity(grt::GRT *grt, grt::MetaClass *meta=0)
  : model_Figure(grt, meta ? meta : grt->get_metaclass(static_class_name())),
     _attributesExpanded(1)

  {
  }

  static std::string static_class_name() { return "workbench.logical.Entity"; }

  grt::IntegerRef attributesExpanded() const { return _attributesExpanded; }
  virtual void attributesExpanded(const grt::IntegerRef &value)
  {
    grt::ValueRef ovalue(_attributesExpanded);
   _attributesExpanded= value;
    member_changed("attributesExpanded", ovalue, value);
  }

  eer_EntityRef entity() const { return _entity; }
  virtual void entity(const eer_EntityRef &value)
  {
    grt::ValueRef ovalue(_entity);
   _entity= value;
    member_changed("entity", ovalue, value);
  }

protected:

  grt::IntegerRef _attributesExpanded;
  eer_EntityRef _entity;
private: // wrapper methods for use by grt
  static grt::ObjectRef create(grt::GRT *grt)
  {
    return grt::ObjectRef(new workbench_logical_Entity(grt));
  }


public:
  static void grt_register(grt::GRT *grt)
  {
    grt::MetaClass *meta= grt->get_metaclass(static_class_name());
    if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
    meta->bind_allocator(&workbench_logical_Entity::create);
    {
      void (workbench_logical_Entity::*setter)(const grt::IntegerRef &)= &workbench_logical_Entity::attributesExpanded;
      grt::IntegerRef (workbench_logical_Entity::*getter)() const= &workbench_logical_Entity::attributesExpanded;
      meta->bind_member("attributesExpanded", new grt::MetaClass::Property<workbench_logical_Entity,grt::IntegerRef >(getter,setter));
    }
    {
      void (workbench_logical_Entity::*setter)(const eer_EntityRef &)= &workbench_logical_Entity::entity;
      eer_EntityRef (workbench_logical_Entity::*getter)() const= &workbench_logical_Entity::entity;
      meta->bind_member("entity", new grt::MetaClass::Property<workbench_logical_Entity,eer_EntityRef >(getter,setter));
    }
  }
};


class GRT_STRUCTS_WORKBENCH_LOGICAL_PUBLIC workbench_logical_Diagram : public model_Diagram
{
  typedef model_Diagram super;
public:
  class ImplData;
  friend class ImplData;
  workbench_logical_Diagram(grt::GRT *grt, grt::MetaClass *meta=0)
  : model_Diagram(grt, meta ? meta : grt->get_metaclass(static_class_name())),
    _data(0)

  {
  }

  virtual ~workbench_logical_Diagram();

  static std::string static_class_name() { return "workbench.logical.Diagram"; }

  virtual model_LayerRef placeNewLayer(double x, double y, double width, double height, const std::string &name);

  ImplData *get_data() const { return _data; }

  void set_data(ImplData *data);
  // default initialization function. auto-called by Ref<Object> constructor
  virtual void init();

protected:

private: // wrapper methods for use by grt
  ImplData *_data;

  static grt::ObjectRef create(grt::GRT *grt)
  {
    return grt::ObjectRef(new workbench_logical_Diagram(grt));
  }

  static grt::ValueRef call_placeNewLayer(grt::internal::Object *self, const grt::BaseListRef &args){ return dynamic_cast<workbench_logical_Diagram*>(self)->placeNewLayer(grt::DoubleRef::cast_from(args[0]), grt::DoubleRef::cast_from(args[1]), grt::DoubleRef::cast_from(args[2]), grt::DoubleRef::cast_from(args[3]), grt::StringRef::cast_from(args[4])); }


public:
  static void grt_register(grt::GRT *grt)
  {
    grt::MetaClass *meta= grt->get_metaclass(static_class_name());
    if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
    meta->bind_allocator(&workbench_logical_Diagram::create);
    meta->bind_method("placeNewLayer", &workbench_logical_Diagram::call_placeNewLayer);
  }
};


class GRT_STRUCTS_WORKBENCH_LOGICAL_PUBLIC workbench_logical_Model : public model_Model
{
  typedef model_Model super;
public:
  class ImplData;
  friend class ImplData;
  workbench_logical_Model(grt::GRT *grt, grt::MetaClass *meta=0)
  : model_Model(grt, meta ? meta : grt->get_metaclass(static_class_name())),
    _data(0)

  {
    _diagrams.content().__retype(grt::ObjectType, "workbench.logical.Diagram");
  }

  virtual ~workbench_logical_Model();

  static std::string static_class_name() { return "workbench.logical.Model"; }

  // diagrams is owned by workbench_logical_Model
  grt::ListRef<workbench_logical_Diagram> diagrams() const { return grt::ListRef<workbench_logical_Diagram>::cast_from(_diagrams); }
private: // the next attribute is read-only
public:

  virtual model_DiagramRef addNewDiagram(long deferRealize);

  ImplData *get_data() const { return _data; }

  void set_data(ImplData *data);
  // default initialization function. auto-called by Ref<Object> constructor
  virtual void init();

protected:

private: // wrapper methods for use by grt
  ImplData *_data;

  static grt::ObjectRef create(grt::GRT *grt)
  {
    return grt::ObjectRef(new workbench_logical_Model(grt));
  }

  static grt::ValueRef call_addNewDiagram(grt::internal::Object *self, const grt::BaseListRef &args){ return dynamic_cast<workbench_logical_Model*>(self)->addNewDiagram(grt::IntegerRef::cast_from(args[0])); }


public:
  static void grt_register(grt::GRT *grt)
  {
    grt::MetaClass *meta= grt->get_metaclass(static_class_name());
    if (!meta) throw std::runtime_error("error initializing grt object class, metaclass not found");
    meta->bind_allocator(&workbench_logical_Model::create);
    {
      void (workbench_logical_Model::*setter)(const grt::ListRef<workbench_logical_Diagram> &)= 0;
      grt::ListRef<workbench_logical_Diagram> (workbench_logical_Model::*getter)() const= 0;
      meta->bind_member("diagrams", new grt::MetaClass::Property<workbench_logical_Model,grt::ListRef<workbench_logical_Diagram> >(getter,setter));
    }
    meta->bind_method("addNewDiagram", &workbench_logical_Model::call_addNewDiagram);
  }
};




inline void register_structs_workbench_logical_xml()
{
  grt::internal::ClassRegistry::register_class<workbench_logical_Connection>();
  grt::internal::ClassRegistry::register_class<workbench_logical_Relationship>();
  grt::internal::ClassRegistry::register_class<workbench_logical_Entity>();
  grt::internal::ClassRegistry::register_class<workbench_logical_Diagram>();
  grt::internal::ClassRegistry::register_class<workbench_logical_Model>();
}

#ifdef AUTO_REGISTER_GRT_CLASSES
static struct _autoreg__structs_workbench_logical_xml { _autoreg__structs_workbench_logical_xml() { register_structs_workbench_logical_xml(); } } __autoreg__structs_workbench_logical_xml;
#endif

#endif
