<commit_before>#ifndef CLPP_DETAIL_OBJECT_HPP
#define CLPP_DETAIL_OBJECT_HPP

#include "clpp/detail/information_accessor.hpp"

#include <vector>
#include <string>

namespace cl {
	namespace detail {
		//================================================================================
		// ObjectHandler struct contains several useful information
		// about the wrapping class and its wrapped object,
		// types, states and functions.
		//
		// Types:
		//     cl_type        : the OpenCL type being wrapped
		//     exception_type : the exception type for the object being wrapped
		//     info_type      : the OpenCL type to query information of the object being wrapped
		// 
		// Functions:
		//     retain  : the OpenCL retain function for the object being wrapped
		//     release : the OpenCL release function for the object being wrapped
		//     getInfo : the OpenCL information function for the object being wrapped
		//================================================================================
		template <typename T>
		struct ObjectHandler {};

		//================================================================================
		// Wraps the OpenCL type T of an object with this class and provides basic
		// object oriented operations which can be unified among all OpenCL primitives.
		// Uses ObjectHandler template specialization in order to retrieve information
		// about OpenCL specific details of its types.
		//
		// This is the base class of all OpenCL objects in this wrapper.
		//================================================================================
		template<typename CLType>
		class Object {
		public:
			using info_type      = typename ObjectHandler<CLType>::info_type;
			using cl_type        = typename ObjectHandler<CLType>::cl_type;

			//============================================================================
			// Returns the underlying OpenCL data of the wrapped object.
			//============================================================================
			auto get() const -> cl_type;
		protected:
			cl_type m_object;

			//============================================================================
			// Constructors & Destructor
			//============================================================================

		public:
			Object<CLType>();
			Object<CLType>(cl_type rhs);
			Object<CLType>(const Object<CLType> & rhs);
			Object<CLType>(Object<CLType> && rhs) = default;

		protected:
			~Object<CLType>();

			//============================================================================
			// Copy and move assignment operator overloadings
			//============================================================================

			auto operator=(const Object<CLType> &  rhs) -> Object<CLType> &;
			auto operator=(      Object<CLType> && rhs) -> Object<CLType> & = default;

			auto operator=(const cl_type &  rhs) -> Object<CLType> &;

			//============================================================================
			// Operators for checking if two objects are equal or unequal.
			//============================================================================

			auto operator==(const Object<CLType> & rhs) const -> bool;
			auto operator!=(const Object<CLType> & rhs) const -> bool;

			//============================================================================
			// Helper methods to access information about the wrapped
			// object. Three forms to allow for best performance in
			// each case and a clean API.
			//============================================================================

			template<typename InfoType>
			auto getInfo(info_type p_info) const -> InfoType;

			template<typename InfoType>
			auto getInfoVector(info_type p_info) const -> std::vector<InfoType>;

			auto getInfoString(info_type p_info) const -> std::string;

		private:
			void release();
			void retain();
		};
	}
}

template<typename CLType>
auto operator==(const cl::detail::Object<CLType> & lhs, const CLType & rhs) -> bool;

template<typename CLType>
auto operator!=(const cl::detail::Object<CLType> & lhs, const CLType & rhs) -> bool;

template<typename CLType>
auto operator==(const CLType & rhs, const cl::detail::Object<CLType> & lhs) -> bool;

template<typename CLType>
auto operator!=(const CLType & rhs, const cl::detail::Object<CLType> & lhs) -> bool;

#endif<commit_msg>added inline to object.hpp<commit_after>#ifndef CLPP_DETAIL_OBJECT_HPP
#define CLPP_DETAIL_OBJECT_HPP

#include "clpp/detail/information_accessor.hpp"

#include <vector>
#include <string>

namespace cl {
	namespace detail {
		//================================================================================
		// ObjectHandler struct contains several useful information
		// about the wrapping class and its wrapped object,
		// types, states and functions.
		//
		// Types:
		//     cl_type        : the OpenCL type being wrapped
		//     exception_type : the exception type for the object being wrapped
		//     info_type      : the OpenCL type to query information of the object being wrapped
		// 
		// Functions:
		//     retain  : the OpenCL retain function for the object being wrapped
		//     release : the OpenCL release function for the object being wrapped
		//     getInfo : the OpenCL information function for the object being wrapped
		//================================================================================
		template <typename T>
		struct ObjectHandler {};

		//================================================================================
		// Wraps the OpenCL type T of an object with this class and provides basic
		// object oriented operations which can be unified among all OpenCL primitives.
		// Uses ObjectHandler template specialization in order to retrieve information
		// about OpenCL specific details of its types.
		//
		// This is the base class of all OpenCL objects in this wrapper.
		//================================================================================
		template<typename CLType>
		class Object {
		public:
			using info_type      = typename ObjectHandler<CLType>::info_type;
			using cl_type        = typename ObjectHandler<CLType>::cl_type;

			//============================================================================
			// Returns the underlying OpenCL data of the wrapped object.
			//============================================================================
			inline auto get() const -> cl_type;
		protected:
			cl_type m_object;

			//============================================================================
			// Constructors & Destructor
			//============================================================================

		public:
			inline Object<CLType>();
			inline Object<CLType>(cl_type rhs);
			inline Object<CLType>(const Object<CLType> & rhs);
			inline Object<CLType>(Object<CLType> && rhs) = default;

		protected:
			inline ~Object<CLType>();

			//============================================================================
			// Copy and move assignment operator overloadings
			//============================================================================

			inline auto operator=(const Object<CLType> &  rhs) -> Object<CLType> &;
			inline auto operator=(      Object<CLType> && rhs) -> Object<CLType> & = default;

			inline auto operator=(const cl_type &  rhs) -> Object<CLType> &;

			//============================================================================
			// Operators for checking if two objects are equal or unequal.
			//============================================================================

			inline auto operator==(const Object<CLType> & rhs) const -> bool;
			inline auto operator!=(const Object<CLType> & rhs) const -> bool;

			//============================================================================
			// Helper methods to access information about the wrapped
			// object. Three forms to allow for best performance in
			// each case and a clean API.
			//============================================================================

			template<typename InfoType>
			inline auto getInfo(info_type p_info) const -> InfoType;

			template<typename InfoType>
			inline auto getInfoVector(info_type p_info) const -> std::vector<InfoType>;

			inline auto getInfoString(info_type p_info) const -> std::string;

		private:
			inline void release();
			inline void retain();
		};
	}
}

template<typename CLType>
inline auto operator==(
	const cl::detail::Object<CLType> & lhs, const CLType & rhs) -> bool;

template<typename CLType>
inline auto operator!=(
	const cl::detail::Object<CLType> & lhs, const CLType & rhs) -> bool;

template<typename CLType>
inline auto operator==(
	const CLType & rhs, const cl::detail::Object<CLType> & lhs) -> bool;

template<typename CLType>
inline auto operator!=(
	const CLType & rhs, const cl::detail::Object<CLType> & lhs) -> bool;

#endif
{'fraction_non_alphanumeric': 0.3219077686323148, 'fraction_numerical': 0.0, 'mean_word_length': 4.582127123977345, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6487080', 'n_tokens_mistral': 2336, 'n_tokens_neox': 1979, 'n_words': 674}