| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* Span.hpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2026/01/13 18:18:53 by bchanot #+# #+# */
- /* Updated: 2026/01/14 16:18:13 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #ifndef SPAN_HPP
- # define SPAN_HPP
- # include <iostream>
- # include <string>
- #include <vector>
- #include <iterator>
- class Span
- {
- public:
- Span( unsigned int const & src );
- Span( Span const & src );
- ~Span();
- Span & operator=( Span const & rhs );
- class isFullException : public std::exception {
- public :
- virtual const char * what() const throw() {
- return ("The Span container is full");
- }
- };
- void addNumber(int const & add);
- unsigned int shortestSpan(void) const;
- unsigned int longestSpan(void) const;
- void fullFillSpan(void);
- void rangeFillSpan(size_t start, size_t end);
- void fillSpan(size_t n);
- unsigned int getSize(void) const;
- private:
- std::vector<int> _values;
- unsigned int _max;
- Span();
- };
- std::ostream & operator<<( std::ostream & o, Span const & i );
- #endif /* ************************************************************ SPAN_H */
|