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

#ifndef X11GLOBALCOMM_H
#define X11GLOBALCOMM_H

#include "common.h"

#include "arts_export.h"

// includes of other idl definitions
#include "core.h"

namespace Arts {
class X11GlobalComm;

class ARTS_EXPORT X11GlobalComm_base : virtual public Arts::GlobalComm_base {
public:
	static unsigned long _IID; // interface ID

	static X11GlobalComm_base *_create(const std::string& subClass = "Arts::X11GlobalComm");
	static X11GlobalComm_base *_fromString(const std::string& objectref);
	static X11GlobalComm_base *_fromReference(Arts::ObjectReference ref, bool needcopy);

	static X11GlobalComm_base *_fromDynamicCast(const Arts::Object& object);
	inline X11GlobalComm_base *_copy() {
		assert(_refCnt > 0);
		_refCnt++;
		return this;
	}

	virtual std::vector<std::string> _defaultPortsIn() const;
	virtual std::vector<std::string> _defaultPortsOut() const;

	void *_cast(unsigned long iid);

};

class ARTS_EXPORT X11GlobalComm_stub : virtual public X11GlobalComm_base, virtual public Arts::GlobalComm_stub {
protected:
	X11GlobalComm_stub();

public:
	X11GlobalComm_stub(Arts::Connection *connection, long objectID);

};

class ARTS_EXPORT X11GlobalComm_skel : virtual public X11GlobalComm_base, virtual public Arts::GlobalComm_skel {
public:
	X11GlobalComm_skel();

	static std::string _interfaceNameSkel();
	std::string _interfaceName();
	bool _isCompatibleWith(const std::string& interfacename);
	void _buildMethodTable();
	void dispatch(Arts::Buffer *request, Arts::Buffer *result,long methodID);
};

}
#include "reference.h"
namespace Arts {
class ARTS_EXPORT X11GlobalComm : public Arts::Object {
private:
	static Arts::Object_base* _Creator();
	X11GlobalComm_base *_cache;
	inline X11GlobalComm_base *_method_call() {
		_pool->checkcreate();
		if(_pool->base) {
			_cache=(X11GlobalComm_base *)_pool->base->_cast(X11GlobalComm_base::_IID);
			assert(_cache);
		}
		return _cache;
	}

protected:
	inline X11GlobalComm(X11GlobalComm_base* b) : Arts::Object(b), _cache(0) {}


public:
	typedef X11GlobalComm_base _base_class;

	inline X11GlobalComm() : Arts::Object(_Creator), _cache(0) {}
	inline X11GlobalComm(const Arts::SubClass& s) :
		Arts::Object(X11GlobalComm_base::_create(s.string())), _cache(0) {}
	inline X11GlobalComm(const Arts::Reference &r) :
		Arts::Object(r.isString()?(X11GlobalComm_base::_fromString(r.string())):(X11GlobalComm_base::_fromReference(r.reference(),true))), _cache(0) {}
	inline X11GlobalComm(const Arts::DynamicCast& c) : Arts::Object(X11GlobalComm_base::_fromDynamicCast(c.object())), _cache(0) {}
	inline X11GlobalComm(const X11GlobalComm& target) : Arts::Object(target._pool), _cache(target._cache) {}
	inline X11GlobalComm(Arts::Object::Pool& p) : Arts::Object(p), _cache(0) {}
	inline static X11GlobalComm null() {return X11GlobalComm((X11GlobalComm_base*)0);}
	inline static X11GlobalComm _from_base(X11GlobalComm_base* b) {return X11GlobalComm(b);}
	inline X11GlobalComm& operator=(const X11GlobalComm& target) {
		if (_pool == target._pool) return *this;
		_pool->Dec();
		_pool = target._pool;
		_cache = target._cache;
		_pool->Inc();
		return *this;
	}
	inline operator Arts::GlobalComm() const { return Arts::GlobalComm(*_pool); }
	inline X11GlobalComm_base* _base() {return _cache?_cache:_method_call();}

	inline bool put(const std::string& variable, const std::string& value);
	inline std::string get(const std::string& variable);
	inline void erase(const std::string& variable);
};

}
// Forward wrapper calls to _base classes:

inline bool Arts::X11GlobalComm::put(const std::string& variable, const std::string& value)
{
	return _cache?static_cast<Arts::GlobalComm_base*>(_cache)->put(variable, value):static_cast<Arts::GlobalComm_base*>(_method_call())->put(variable, value);
}

inline std::string Arts::X11GlobalComm::get(const std::string& variable)
{
	return _cache?static_cast<Arts::GlobalComm_base*>(_cache)->get(variable):static_cast<Arts::GlobalComm_base*>(_method_call())->get(variable);
}

inline void Arts::X11GlobalComm::erase(const std::string& variable)
{
	 _cache?static_cast<Arts::GlobalComm_base*>(_cache)->erase(variable):static_cast<Arts::GlobalComm_base*>(_method_call())->erase(variable);
}

#endif /* X11GLOBALCOMM_H */
