#include <coral/core/Element.h>
#include <coral/coral.h>
#include <coral/core/io/io.h>

#include <iostream>

using namespace coral;

int main(int argc, char** argv) {
	init_coral_framework();
	autounref<Language> uml14
		= Language::__getLanguage__("UML", 1, 4);

	Element* c = uml14->getElement("Class")->newElement();
	Element* m = uml14->getElement("Model")->newElement();
	autounref<Element> _c(c);
	autounref<Element> _m(m);

	m->__getSlotByName__("ownedElement").insert(c);

	(c->__getSlotByName__("isAbstract")[0])->__setEValue__(1);

	(c->__getSlotByName__("visibility")[0])->__setEValueByName__("private");

	Sequence o;
	o.append(m);
	io::saveDocument_raw(std::cout, &o, "1.2");

	m->__getSlotByName__("ownedElement").drop(c);
	return 0;
}
