/** @file objectproxy.h
*	Proxy implemented using an Object
*	@author Chris Burns (cburns@ea.com)
*
*	(c) 2013 Electronic Arts Inc.
*/

#ifndef EABASETYPESPLUS_OBJECTPROXY_H_
#define EABASETYPESPLUS_OBJECTPROXY_H_

#include "EABaseTypesPlus/iproxy.h"

namespace EA
{
	namespace Types
	{
		EABASETYPES_FORWARD_DECLARATION(class, ObjectProxy)

		/*! @class ObjectProxy iproxy.h	"ux_base/iproxy.h"
		*	@brief A proxy implemented as an object
		*/
		class ObjectProxy : public IProxy
		{
		public:

			/*!
			*	ObjectProxy c'tor
			*	@param factory	The factory for EABaseTypes
			*/
			ObjectProxy(Factory* factory);

			/*!
			*	ObjectProxy d'tor
			*/
			virtual ~ObjectProxy();

			virtual ObjectReturn ToObject();

			void Add(const char* path, BaseTypeIn baseType);
			void Remove(const char* path);
            
            virtual void List(FunctionIn callback, ArrayIn visited);

			virtual FunctionReturn GetFunction(const char* path);

			virtual ObjectReturn GetInterface(const char* path, ArrayIn schema);

			virtual ObjectReturn GetInterface(const char* path, const char** schema);

		protected:
        
            BaseTypeReturn ListBaseType(BaseTypeIn baseType, ArrayIn visited);

			Factory*	mFactory;
			BaseTypeRef	mBaseType;
		};
	}
}

#endif /* EABASETYPESPLUS_OBJECTPROXY_H_ */
