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

#include <coral/core/python_compat.h>

#include <iostream>

int main() {
	coral::init_coral_framework();
	coral::autounref<coral::Language> uml14
		= coral::Language::__getLanguage__("UML", 1, 4);
	coral_assert(uml14.get());
	coral::Atom* _m = uml14->getElement("Method")->newAtom();
	coral::Element* m = static_cast<coral::Element*>(_m);
	std::cout << "*** Created UML 1.4 " << m->__type__()->getName() << std::endl;
	std::cout << m->__str__() << std::endl;

	PythonSequenceIteratorSecond<coral::Element::slots_type::iterator, coral::Slot*>* p
		= m->__all_slots__();
	coral::Slot* mf;
	while ((mf = p->next()) != NULL) {
		std::cout << mf->__str__() << " " << mf->getProperty()->getName() << std::endl;
	}
	p->unref();

	m->unref();
	std::cout << "*** Done" << std::endl;
	return 0;
}
