/src/sleek/device/console/details/blocking_queue.h
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: fast_oss.h
===================================================================
--- fast_oss.h (revision 22)
+++ fast_oss.h (nonexistent)
@@ -1,189 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library. */
-/* Copyright (c) 2014 Gabi Melman. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#pragma once
-
-// A faster-than-ostringstream class
-// uses stack_buf as the underlying buffer (upto 256 bytes before using the heap)
-
-#include <ostream>
-#include <iomanip>
-#include "fast_istostr.h"
-#include "stack_buf.h"
-#include<iostream>
-
-namespace spdlog
-{
-namespace details
-{
-
-class stack_devicebuf :public std::streambuf
-{
-public:
- static const unsigned short stack_size = 256;
- using stackbuf_t = stack_buf<stack_size>;
-
- stack_devicebuf() = default;
- ~stack_devicebuf() = default;
-
- stack_devicebuf(const stack_devicebuf& other) :std::basic_streambuf<char>(), _stackbuf(other._stackbuf)
- {}
-
- stack_devicebuf(stack_devicebuf&& other):
- std::basic_streambuf<char>(),
- _stackbuf(std::move(other._stackbuf))
- {
- other.clear();
- }
-
- stack_devicebuf& operator=(stack_devicebuf other)
- {
- std::swap(_stackbuf, other._stackbuf);
- return *this;
- }
-
- const stackbuf_t& buf() const
- {
- return _stackbuf;
- }
- std::size_t size() const
- {
- return _stackbuf.size();
- }
-
- void clear()
- {
- _stackbuf.clear();
- }
-
-protected:
- // copy the give buffer into the accumulated fast buffer
- std::streamsize xsputn(const char_type* s, std::streamsize count) override
- {
- _stackbuf.append(s, static_cast<unsigned int>(count));
- return count;
- }
-
- int_type overflow(int_type ch) override
- {
- if (traits_type::not_eof(ch))
- {
- char c = traits_type::to_char_type(ch);
- xsputn(&c, 1);
- }
- return ch;
- }
-private:
- stackbuf_t _stackbuf;
-};
-
-
-class fast_oss :public std::ostream
-{
-public:
- fast_oss() :std::ostream(&_dev) {}
- ~fast_oss() = default;
-
- fast_oss(const fast_oss& other) :std::basic_ios<char>(), std::ostream(&_dev), _dev(other._dev)
- {}
-
- fast_oss(fast_oss&& other) :std::basic_ios<char>(), std::ostream(&_dev), _dev(std::move(other._dev))
- {
- other.clear();
- }
-
-
- fast_oss& operator=(fast_oss other)
- {
- swap(*this, other);
- return *this;
- }
-
- void swap(fast_oss& first, fast_oss& second) // nothrow
- {
- using std::swap;
- swap(first._dev, second._dev);
- }
-
- std::string str()
- {
- auto& buffer = _dev.buf();
- const char*data = buffer.data();
- return std::string(data, data+buffer.size());
- }
-
- const stack_devicebuf::stackbuf_t& buf() const
- {
- return _dev.buf();
- }
-
-
- std::size_t size() const
- {
- return _dev.size();
- }
-
- void clear()
- {
- _dev.clear();
- }
-
- //
- // The following were added because they significantly boost to perfromance
- //
- void putc(char c)
- {
- _dev.sputc(c);
- }
-
- // put int and pad with zeroes if smalled than min_width
- void put_int(int n, size_t padding)
- {
- std::string s;
- details::fast_itostr(n, s, padding);
- _dev.sputn(s.data(), s.size());
- }
-
- void put_data(const char* p, std::size_t data_size)
- {
- _dev.sputn(p, data_size);
- }
-
- void put_str(const std::string& s)
- {
- _dev.sputn(s.data(), s.size());
- }
-
- void put_fast_oss(const fast_oss& oss)
- {
- auto& buffer = oss.buf();
- _dev.sputn(buffer.data(), buffer.size());
- }
-
-
-private:
- stack_devicebuf _dev;
-};
-}
-}
/fast_oss.h
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: fast_istostr.h
===================================================================
--- fast_istostr.h (revision 22)
+++ fast_istostr.h (nonexistent)
@@ -1,130 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library. */
-/* Copyright (c) 2014 Gabi Melman. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#pragma once
-#include <string>
-
-//Fast to int to string
-//Base on :http://stackoverflow.com/a/4351484/192001
-//Modified version to pad zeros according to padding arg
-
-namespace spdlog
-{
-namespace details
-{
-
-const char digit_pairs[201] =
-{
- "00010203040506070809"
- "10111213141516171819"
- "20212223242526272829"
- "30313233343536373839"
- "40414243444546474849"
- "50515253545556575859"
- "60616263646566676869"
- "70717273747576777879"
- "80818283848586878889"
- "90919293949596979899"
-};
-
-
-inline std::string& fast_itostr(int n, std::string& s, size_t padding)
-{
- if (n == 0)
- {
- s = std::string(padding, '0');
- return s;
- }
-
- int sign = -(n < 0);
- unsigned int val = static_cast<unsigned int>((n^sign) - sign);
-
- size_t size;
- if (val >= 10000)
- {
- if (val >= 10000000)
- {
- if (val >= 1000000000)
- size = 10;
- else if (val >= 100000000)
- size = 9;
- else
- size = 8;
- }
- else
- {
- if (val >= 1000000)
- size = 7;
- else if (val >= 100000)
- size = 6;
- else
- size = 5;
- }
- }
- else
- {
- if (val >= 100)
- {
- if (val >= 1000)
- size = 4;
- else
- size = 3;
- }
- else
- {
- if (val >= 10)
- size = 2;
- else
- size = 1;
- }
- }
- size -= sign;
- if (size < padding)
- size = padding;
-
- s.resize(size);
- char* c = &s[0];
- if (sign)
- *c = '-';
-
- c += size - 1;
- while (val >= 100)
- {
- size_t pos = val % 100;
- val /= 100;
- *(short*)(c - 1) = *(short*)(digit_pairs + 2 * pos);
- c -= 2;
- }
- while (val > 0)
- {
- *c-- = static_cast<char>('0' + (val % 10));
- val /= 10;
- }
-
- while (c >= s.data())
- *c-- = '0';
- return s;
-}
-}
-}
/fast_istostr.h
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: stack_buf.h
===================================================================
--- stack_buf.h (revision 22)
+++ stack_buf.h (nonexistent)
@@ -1,134 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library. */
-/* Copyright (c) 2014 Gabi Melman. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#pragma once
-
-#include <algorithm>
-#include <array>
-#include <vector>
-#include <cstring>
-
-namespace spdlog
-{
-namespace details
-{
-
-// Fast memory storage on the stack when possible or in std::vector
-template<unsigned short STACK_SIZE>
-class stack_buf
-{
-public:
- static const unsigned short stack_size = STACK_SIZE;
- stack_buf() :_v(), _stack_size(0) {}
- ~stack_buf() = default;
- stack_buf(const stack_buf& other):stack_buf(other, delegate_copy_move {})
- {}
-
- stack_buf(stack_buf&& other):stack_buf(other, delegate_copy_move {})
- {
- other.clear();
- }
- template<class T1>
- stack_buf& operator=(T1&& other)
- {
- _stack_size = other._stack_size;
- if (other.vector_used())
- _v = std::forward<T1>(other)._v;
- else
- std::copy_n(other._stack_array.begin(), other._stack_size, _stack_array.begin());
- return *this;
- }
-
- void append(const char* buf, std::size_t buf_size)
- {
- //If we are aleady using _v, forget about the stack
- if (vector_used())
- {
- _v.insert(_v.end(), buf, buf + buf_size);
- }
- //Try use the stack
- else
- {
- if (_stack_size + buf_size <= STACK_SIZE)
- {
- std::memcpy(&_stack_array[_stack_size], buf, buf_size);
- _stack_size += buf_size;
- }
- //Not enough stack space. Copy all to _v
- else
- {
- _v.reserve(_stack_size + buf_size);
- _v.insert(_v.end(), _stack_array.begin(), _stack_array.begin() + _stack_size);
- _v.insert(_v.end(), buf, buf + buf_size);
- }
- }
- }
-
-
- void clear()
- {
- _stack_size = 0;
- _v.clear();
- }
-
- const char* data() const
- {
- if (vector_used())
- return _v.data();
- else
- return _stack_array.data();
- }
-
- std::size_t size() const
- {
- if (vector_used())
- return _v.size();
- else
- return _stack_size;
- }
-
-private:
- struct delegate_copy_move {};
- template<class T1>
- stack_buf(T1&& other, delegate_copy_move)
- {
- _stack_size = other._stack_size;
- if (other.vector_used())
- _v = std::forward<T1>(other)._v;
- else
- std::copy_n(other._stack_array.begin(), other._stack_size, _stack_array.begin());
- }
-
- inline bool vector_used() const
- {
- return !(_v.empty());
- }
-
- std::vector<char> _v;
- std::array<char, STACK_SIZE> _stack_array;
- std::size_t _stack_size;
-};
-
-}
-} //namespace spdlog { namespace details {
/stack_buf.h
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property