Skip to content

Commit

Permalink
Merge pull request #44 from open-space-collective/dev@lucas
Browse files Browse the repository at this point in the history
Dev@lucas
  • Loading branch information
lucas-bremond authored Aug 27, 2018
2 parents 279d96e + 0126ea6 commit 315f7b8
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 55 deletions.
32 changes: 32 additions & 0 deletions include/Library/Core/Containers/Array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,38 @@ class Array : public std::vector<T>

Array ( std::initializer_list<T> aList ) ;

/// @brief Copy constructor
///
/// @param [in] anArray An array

Array ( const Array& anArray ) = default ;

/// @brief Move constructor (array)
///
/// @param [in] anArray An array

Array ( Array&& anArray ) = default ;

/// @brief Move constructor (vector)
///
/// @param [in] aVector A vector

Array ( std::vector<T>&& aVector ) ;

/// @brief Copy assignment operator
///
/// @param [in] anArray An array
/// @return Reference to array

Array<T>& operator = ( const Array<T>& anArray ) = default ;

/// @brief Move assignment operator
///
/// @param [in] anArray An array
/// @return Reference to array

Array<T>& operator = ( Array<T>&& anArray ) = default ;

/// @brief Concatenate array
///
/// @code
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/Containers/Dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Dictionary

~Dictionary ( ) ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] aDictionary A dictionary
/// @return Reference to dictionary
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/Containers/Object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Object

~Object ( ) ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] anObject An object
/// @return Reference to object
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/FileSystem/Directory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Directory

Directory ( const Directory& aDirectory ) ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] aDirectory A directory
/// @return Directory
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/FileSystem/File.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class File

File ( const File& aFile ) ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] aFile A file
/// @return File
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/FileSystem/Path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Path

~Path ( ) ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] aPath A path
/// @return Path
Expand Down
4 changes: 2 additions & 2 deletions include/Library/Core/Logger/Pump.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Pump
this->accessStream() << anObject ;
}

return (*this) ;
return *this ;

}

Expand All @@ -78,7 +78,7 @@ class Pump
this->accessStream() << aStreamManipulator ;
}

return (*this) ;
return *this ;

}

Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/Types/Integer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Integer

Integer ( double ) = delete ;

/// @brief Assignment operator
/// @brief Copy assignment operator
///
/// @param [in] anInteger An integer
/// @return Reference to integer
Expand Down
2 changes: 1 addition & 1 deletion include/Library/Core/Utilities/Print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Print

stream_ << std::setw(40) << std::setfill(' ') << anObject << " " ;

return (*this) ;
return *this ;

}

Expand Down
9 changes: 8 additions & 1 deletion src/Library/Core/Containers/Array.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ namespace ctnr
: std::vector<T>(aList)
{

}

template <class T>
Array<T>::Array ( std::vector<T>&& aVector )
: std::vector<T>(std::move(aVector))
{

}

template <class T>
Expand Down Expand Up @@ -318,7 +325,7 @@ typename Array<T>::Iterator Array<T>::find (
template <class T>
Array<T> Array<T>::Empty ( )
{
return Array<T>(std::vector<T>()) ;
return std::move(std::vector<T>()) ;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
20 changes: 10 additions & 10 deletions src/Library/Core/Containers/Dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Dictionary::Iterator& Dictionary::Iterator::operator = (
mapIt_ = anIterator.mapIt_ ;
}

return (*this) ;
return *this ;

}

Expand All @@ -62,7 +62,7 @@ bool Dictionary::Iterator::operator != (

const Dictionary::Iterator& Dictionary::Iterator::operator * ( ) const
{
return (*this) ;
return *this ;
}

const Dictionary::Iterator* Dictionary::Iterator::operator -> ( ) const
Expand All @@ -72,7 +72,7 @@ const Dictionary::Iterator* Dictionary::Iterator::operator -> ( )

Dictionary::Iterator& Dictionary::Iterator::operator * ( )
{
return (*this) ;
return *this ;
}

Dictionary::Iterator* Dictionary::Iterator::operator -> ( )
Expand All @@ -90,7 +90,7 @@ Dictionary::Iterator& Dictionary::Iterator::operator ++ ( )

++mapIt_ ;

return (*this) ;
return *this ;

}

Expand All @@ -104,7 +104,7 @@ Dictionary::Iterator& Dictionary::Iterator::operator -- ( )

--mapIt_ ;

return (*this) ;
return *this ;

}

Expand Down Expand Up @@ -171,7 +171,7 @@ Dictionary::ConstIterator& Dictionary::ConstIterator::operator = (
mapIt_ = aConstIterator.mapIt_ ;
}

return (*this) ;
return *this ;

}

Expand All @@ -187,7 +187,7 @@ bool Dictionary::ConstIterator::operator != (

const Dictionary::ConstIterator& Dictionary::ConstIterator::operator * ( ) const
{
return (*this) ;
return *this ;
}

const Dictionary::ConstIterator* Dictionary::ConstIterator::operator -> ( ) const
Expand All @@ -205,7 +205,7 @@ Dictionary::ConstIterator& Dictionary::ConstIterator::operator ++ ( )

++mapIt_ ;

return (*this) ;
return *this ;

}

Expand All @@ -219,7 +219,7 @@ Dictionary::ConstIterator& Dictionary::ConstIterator::operator -- ( )

--mapIt_ ;

return (*this) ;
return *this ;

}

Expand Down Expand Up @@ -270,7 +270,7 @@ Dictionary& Dictionary::operator = (
map_ = aDictionary.map_ ;
}

return (*this) ;
return *this ;

}

Expand Down
2 changes: 1 addition & 1 deletion src/Library/Core/Containers/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ Object& Object::operator = (
objectImplUPtr_.reset((anObject.objectImplUPtr_ != nullptr) ? anObject.objectImplUPtr_->clone() : nullptr) ;
}

return (*this) ;
return *this ;

}

Expand Down
36 changes: 18 additions & 18 deletions src/Library/Core/Types/Integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Integer& Integer::operator = (
type_ = Integer::Type::Defined ;
value_ = anInteger ;

return (*this) ;
return *this ;

}

Expand Down Expand Up @@ -122,7 +122,7 @@ Integer Integer::operator + (

if (type_ != Integer::Type::Defined)
{
return (*this) ;
return *this ;
}
else if (anInteger.type_ != Integer::Type::Defined)
{
Expand Down Expand Up @@ -170,7 +170,7 @@ Integer Integer::operator - (

if (type_ != Integer::Type::Defined)
{
return (*this) ;
return *this ;
}
else if (anInteger.type_ != Integer::Type::Defined)
{
Expand Down Expand Up @@ -413,11 +413,11 @@ Integer Integer::operator % (
}
else if (!this->isInfinity() && anInteger.isInfinity())
{
return (*this) ;
return *this ;
}
else if ((!this->isInfinity()) && this->isStrictlyPositive() && (!anInteger.isInfinity()) && (anInteger.value_ == std::numeric_limits<Integer::ValueType>::min()))
{
return (*this) ;
return *this ;
}
else if ((!anInteger.isInfinity()) && (std::abs(anInteger.value_) == 1))
{
Expand Down Expand Up @@ -468,7 +468,7 @@ Integer& Integer::operator += (

(*this) = (*this) + anInteger ;

return (*this) ;
return *this ;

}

Expand All @@ -477,7 +477,7 @@ Integer& Integer::operator -= (

(*this) = (*this) - anInteger ;

return (*this) ;
return *this ;

}

Expand All @@ -486,7 +486,7 @@ Integer& Integer::operator *= (

(*this) = (*this) * anInteger ;

return (*this) ;
return *this ;

}

Expand All @@ -495,7 +495,7 @@ Integer& Integer::operator /= (

(*this) = (*this) / anInteger ;

return (*this) ;
return *this ;

}

Expand All @@ -504,7 +504,7 @@ Integer& Integer::operator %= (

(*this) = (*this) % anInteger ;

return (*this) ;
return *this ;

}

Expand All @@ -513,7 +513,7 @@ Integer& Integer::operator += (

(*this) = (*this) + Integer(anInteger) ;

return (*this) ;
return *this ;

}

Expand All @@ -522,7 +522,7 @@ Integer& Integer::operator -= (

(*this) = (*this) - Integer(anInteger) ;

return (*this) ;
return *this ;

}

Expand All @@ -531,7 +531,7 @@ Integer& Integer::operator *= (

(*this) = (*this) * Integer(anInteger) ;

return (*this) ;
return *this ;

}

Expand All @@ -540,7 +540,7 @@ Integer& Integer::operator /= (

(*this) = (*this) / Integer(anInteger) ;

return (*this) ;
return *this ;

}

Expand All @@ -549,7 +549,7 @@ Integer& Integer::operator %= (

(*this) = (*this) % Integer(anInteger) ;

return (*this) ;
return *this ;

}

Expand Down Expand Up @@ -585,7 +585,7 @@ Integer operator % (

Integer Integer::operator + ( ) const
{
return (*this) ;
return *this ;
}

Integer Integer::operator - ( ) const
Expand Down Expand Up @@ -654,7 +654,7 @@ Integer& Integer::operator ++ ( )

}

return (*this) ;
return *this ;

}

Expand Down Expand Up @@ -688,7 +688,7 @@ Integer& Integer::operator -- ( )

}

return (*this) ;
return *this ;

}

Expand Down
Loading

0 comments on commit 315f7b8

Please sign in to comment.