From 92cab935d7b0e41dad6a651d6a2c9a86cf12b68f Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 6 Dec 2016 16:28:06 +0100 Subject: [PATCH] prepare Object constructors --- alib2common/src/object/Object.cpp | 24 +++++++++++++++++++++++- alib2common/src/object/Object.h | 7 +++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/alib2common/src/object/Object.cpp b/alib2common/src/object/Object.cpp index 54121572ff..f6925ff508 100644 --- a/alib2common/src/object/Object.cpp +++ b/alib2common/src/object/Object.cpp @@ -6,7 +6,11 @@ */ #include "Object.h" -#include "../core/xmlApi.hpp" +#include <core/xmlApi.hpp> +#include <primitive/Integer.h> +#include <primitive/Character.h> +#include <primitive/String.h> +#include <container/ObjectsPair.h> namespace alib { @@ -14,6 +18,24 @@ void Object::inc ( ) { this->operator ++ ( ); } +Object::Object ( int number ) : alib::WrapperBase < ObjectBase > ( primitive::Integer ( number ) ) { +} + +Object::Object ( int number1, int number2 ) : Object ( Object { primitive::Integer ( number1 ) }, Object { primitive::Integer ( number2 ) } ) { +} + +Object::Object ( Object object1, Object object2 ) : alib::WrapperBase < ObjectBase > ( container::ObjectsPair < Object, Object > { std::make_pair ( std::move ( object1 ), std::move ( object2 ) ) } ) { +} + +Object::Object ( char character ) : alib::WrapperBase < ObjectBase > ( primitive::Character ( character ) ) { +} + +Object::Object ( std::string string ) : alib::WrapperBase < ObjectBase > ( primitive::String ( std::move ( string ) ) ) { +} + +Object::Object ( const char * string ) : Object ( ( std::string ) string ) { +} + auto ObjectDeleter = xmlApi < alib::Object >::InputContextDeleter ( ); } diff --git a/alib2common/src/object/Object.h b/alib2common/src/object/Object.h index 285743dd60..08915aa930 100644 --- a/alib2common/src/object/Object.h +++ b/alib2common/src/object/Object.h @@ -20,6 +20,13 @@ class Object : public alib::WrapperBase < ObjectBase > { using alib::WrapperBase < ObjectBase >::WrapperBase; public: + explicit Object ( Object label1, Object label2 ); + explicit Object ( int number ); + explicit Object ( int number1, int number2 ); + explicit Object ( char character ); + explicit Object ( std::string string ); + explicit Object ( const char * string ); + void inc ( ); static const std::string & getXmlTagRefName() { -- GitLab