/* this file was generated by the MCOP idl compiler - DO NOT EDIT */

#include "x11globalcomm.h"

// Implementation
Arts::X11GlobalComm_base *Arts::X11GlobalComm_base::_create(const std::string& subClass)
{
	Arts::Object_skel *skel = Arts::ObjectManager::the()->create(subClass);
	assert(skel);
	Arts::X11GlobalComm_base *castedObject = (Arts::X11GlobalComm_base *)skel->_cast(Arts::X11GlobalComm_base::_IID);
	assert(castedObject);
	return castedObject;
}

Arts::X11GlobalComm_base *Arts::X11GlobalComm_base::_fromString(const std::string& objectref)
{
	Arts::ObjectReference r;

	if(Arts::Dispatcher::the()->stringToObjectReference(r,objectref))
		return Arts::X11GlobalComm_base::_fromReference(r,true);
	return 0;
}

Arts::X11GlobalComm_base *Arts::X11GlobalComm_base::_fromDynamicCast(const Arts::Object& object)
{
	if(object.isNull()) return 0;

	Arts::X11GlobalComm_base *castedObject = (Arts::X11GlobalComm_base *)object._base()->_cast(Arts::X11GlobalComm_base::_IID);
	if(castedObject) return castedObject->_copy();

	return _fromString(object._toString());
}

Arts::X11GlobalComm_base *Arts::X11GlobalComm_base::_fromReference(Arts::ObjectReference r, bool needcopy)
{
	Arts::X11GlobalComm_base *result;
	result = (Arts::X11GlobalComm_base *)Arts::Dispatcher::the()->connectObjectLocal(r,"Arts::X11GlobalComm");
	if(result)
	{
		if(!needcopy)
			result->_cancelCopyRemote();
	}
	else
	{
		Arts::Connection *conn = Arts::Dispatcher::the()->connectObjectRemote(r);
		if(conn)
		{
			result = new Arts::X11GlobalComm_stub(conn,r.objectID);
			if(needcopy) result->_copyRemote();
			result->_useRemote();
			if (!result->_isCompatibleWith("Arts::X11GlobalComm")) {
				result->_release();
				return 0;
			}
		}
	}
	return result;
}

std::vector<std::string> Arts::X11GlobalComm_base::_defaultPortsIn() const {
	std::vector<std::string> ret;
	return ret;
}
std::vector<std::string> Arts::X11GlobalComm_base::_defaultPortsOut() const {
	std::vector<std::string> ret;
	return ret;
}

void *Arts::X11GlobalComm_base::_cast(unsigned long iid)
{
	if(iid == Arts::X11GlobalComm_base::_IID) return (Arts::X11GlobalComm_base *)this;
	if(iid == Arts::GlobalComm_base::_IID) return (Arts::GlobalComm_base *)this;
	if(iid == Arts::Object_base::_IID) return (Arts::Object_base *)this;
	return 0;
}

Arts::X11GlobalComm_stub::X11GlobalComm_stub()
{
	// constructor for subclasses (don't use directly)
}

Arts::X11GlobalComm_stub::X11GlobalComm_stub(Arts::Connection *connection, long objectID)
	: Arts::Object_stub(connection, objectID)
{
	// constructor to create a stub for an object
}

std::string Arts::X11GlobalComm_skel::_interfaceName()
{
	return "Arts::X11GlobalComm";
}

bool Arts::X11GlobalComm_skel::_isCompatibleWith(const std::string& interfacename)
{
	if (interfacename == "Arts::X11GlobalComm") return true;
	if (interfacename == "Arts::GlobalComm") return true;
	if (interfacename == "Arts::Object") return true;
	return false;
}

std::string Arts::X11GlobalComm_skel::_interfaceNameSkel()
{
	return "Arts::X11GlobalComm";
}

void Arts::X11GlobalComm_skel::_buildMethodTable()
{
	Arts::Buffer m;
	m.fromString(
        "MethodTable:",
		"MethodTable"
	);
	Arts::GlobalComm_skel::_buildMethodTable();
}

Arts::X11GlobalComm_skel::X11GlobalComm_skel()
{
}

Arts::Object_base* Arts::X11GlobalComm::_Creator() {
	return Arts::X11GlobalComm_base::_create();
}

unsigned long Arts::X11GlobalComm_base::_IID = Arts::MCOPUtils::makeIID("Arts::X11GlobalComm");

static Arts::IDLFileReg IDLFileReg_x11globalcomm("x11globalcomm",
    "IDLFile:000000010000000000000000000000000100000014417274733a3a58313147"
    "6c6f62616c436f6d6d000000000100000011417274733a3a476c6f62616c436f6d6d00"
    "0000000000000000000000000000000000000000"
);
