BOOS Core API 3.1
- api::Collection<Type>
- api::Heap
- api::IllegalValue<Type>
- api::Interrupt
- api::Iterable<Type>
- api::Iterator<Type>
- api::Kernel
- api::List<Type>
- api::ListIterator<Type>
- api::Mutex
- api::Object
- api::ProcessorInterrupt
- api::ProcessorPll
- api::ProcessorRegisters
- api::ProcessorTimer
- api::Queue<Type>
- api::Resource
- api::Runtime
- api::Scheduler
- api::Semaphore
- api::Stack<Type>
- api::String<Char>
- api::Synchronizable
- api::System
- api::Task
- api::Thread
- api::Timer
- api::Toggle
- api::Value<Type>
- library::AbstractBuffer<Type,Alloc>
- library::AbstractLinkedList<Type,Alloc>
- library::Align<Type,SIZEOF,Alloc>
- library::Buffer<Type,COUNT,Alloc>
- library::CircularList<Type,Alloc>
- library::Heap
- library::LinkedList<Type,Alloc>
- library::LinkedNode<Type,Alloc>
- library::Memory
- library::Stack<Type,Alloc>
- library::String<Char,Alloc>
- library::Toggle<Alloc>
BOOS Core API 2.2
- core::Allocator
- core::Interrupt
- core::InterruptTask
- core::Mutex
- core::Object<Alloc>
- core::Semaphore
- core::Synchronizer
- core::System
- core::Thread
- core::ThreadTask
- core::Timer
- core::TimerInterrupt
- util::AbstractBuffer<Type,Alloc>
- util::AbstractLinkedList<Type,Alloc>
- util::Align<Type,SIZEOF,Alloc>
- util::Allocator
- util::Buffer<Type,COUNT,Alloc>
- util::CircularList<Type,Alloc>
- util::Heap
- util::LinkedList<Type,Alloc>
- util::LinkedNode<Type,Alloc>
- util::Memory
- util::Object<Alloc>
- util::Stack<Type,Alloc>
- util::Toggle<Alloc>
Baigudin Software participates in OS DAY 2017 conference
The Baigudin Software Company has participated in OS DAY – a fourth scientific-practical conference, which aims to determine a mission of Russia in developing sphere of operating systems.
Class «util::Buffer<Type,COUNT,Alloc>»
Buffer class in static and dynamic specializations.
This class has two specializations of the template. The first one specializes a class with a buffer of elements that is declared as the part of self class data structure. The second one allocates necessary size of a buffer in dynamic memory.
Parameters:
Type — data type of buffer element.
COUNT = 0 — count of buffer elements.
Alloc = Allocator — heap memory allocator class.
- util::Buffer<Type,COUNT,Alloc>
- public util::AbstractBuffer<Type,Alloc>
- public util::Object<Alloc>
- public Object<Alloc>
- public api::Object
- public Object<Alloc>
- public api::Collection<Type>
- public api::IllegalValue<Type>
- public api::Object
- public api::IllegalValue<Type>
- public util::Object<Alloc>
- public util::AbstractBuffer<Type,Alloc>
public:
Buffer(int32 count, const Type illegal);
Buffer(int32 count, const Type illegal, Type* buf);
Buffer(int32 count, Type* buf);
virtual void fill(Type value);
virtual void fill(Type value, int32 count);
virtual void fill(Type value, int32 index, int32 count);
virtual void illegal(const Type value);
virtual bool isConstructed() const;
virtual bool isIllegal(const Type& value) const;
static bool isObject(const Type* obj);
void operator =(const AbstractBuffer<Type,Alloc>& buf);
void operator =(const Buffer<Type,COUNT,Alloc>& buf);
void operator delete(void* ptr);
void* operator new(size_t size);
void* operator new(size_t size, void* ptr);
protected:
static Type alloc(size_t size);
public: Buffer();
Constructor.
public: Buffer(const Type illegal);
Constructor.
Parameters:
illegal — illegal value.
public: Buffer(int32 count);
Constructor.
Parameters:
count — count of buffer elements.
public: Buffer(int32 count, const Type illegal);
Constructor.
Parameters:
count — count of buffer elements.
illegal — illegal value.
public: Buffer(int32 count, const Type illegal, Type* buf);
Constructor.
NOTE: Given external buffer has to exist until this object is being lived, and will NOT be deleted when the buffer is being deleted.
Parameters:
count — number of elements.
illegal — illegal value.
buf — pointer to external buffer.
public: Buffer(int32 count, Type* buf);
Constructor.
NOTE: Given external buffer has to exist until this object is being lived, and will NOT be deleted when the buffer is being deleted.
Parameters:
count — number of elements.
buf — pointer to external buffer.
public: virtual ~Buffer();
Destructor.
public: virtual void fill(Type value);
Fills this buffer by given value.
Parameters:
value — filling value.
public: virtual void fill(Type value, int32 count);
Fills this buffer by given value.
Parameters:
value — filling value.
count — count of filling elements.
public: virtual void fill(Type value, int32 index, int32 count);
Fills this buffer by given value.
Parameters:
value — filling value.
index — begin index.
count — count of filling elements.
public: virtual Type illegal() const;
Returns illegal element which will be returned as error value.
Returns:
illegal element.
public: virtual void illegal(const Type value);
Sets illegal element which will be returned as error value.
Parameters:
value — illegal value.
public: virtual bool isConstructed() const;
Tests if this object has been constructed.
Returns:
true if object has been constructed successfully.
public: virtual bool isEmpty() const;
Tests if this collection has elements.
Returns:
true if this collection does not contain any elements.
public: virtual bool isIllegal(const Type& value) const;
Tests if given value is an illegal.
Parameters:
value — testing value.
true — if value is an illegal.
public: static bool isObject(const Type* obj);
Tests if given object has been constructed object.
Parameters:
obj — pointer to object.
Returns:
true if object has been constructed successfully.
public: virtual int32 length() const;
Returns a number of elements in this container.
Returns:
number of elements.
public: void operator =(const AbstractBuffer<Type,Alloc>& buf);
Assignment operator.
If the source buffer is greater than this buffer, only cropped data of that will be copied.
Parameters:
buf — reference to source buffer.
public: void operator =(const Buffer<Type,COUNT,Alloc>& buf);
Assignment operator.
If the source buffer is greater than this buffer, only cropped data of that will be copied.
Parameters:
buf — reference to source buffer.
public: void operator delete(void* ptr);
Operator delete.
Parameters:
ptr — address of allocated memory block or a null pointer.
public: void* operator new(size_t size);
Operator new.
Parameters:
size — number of bytes to allocate.
Returns:
allocated memory address or a null pointer.
public: void* operator new(size_t size, void* ptr);
Operator new.
Parameters:
size — unused.
ptr — pointer to reserved memory area
Returns:
given pointer.
public: Type& operator [](int32 i);
Returns an element of this buffer.
Parameters:
i — an element index.
Returns:
an element.
public: virtual int32 size() const;
Returns this buffer size in byte.
Returns:
buffer byte size.
protected: static Type alloc(size_t size);
Allocates memory.
Parameters:
size — number of bytes to allocate.
Returns:
allocated memory address or a null pointer.
protected: virtual Type* buffer() const;
Returns a pointer to the fist buffer element.
Returns:
pointer to buffer or NULL.
protected: virtual void copy(const AbstractBuffer& buf);
Copies buffer to buffer.
If the source buffer greater than this buffer, then only cropped data of that will be and copied.
Parameters:
buf — reference to source buffer.
protected: static void free(void* ptr);
Frees an allocated memory.
Parameters:
ptr — address of allocated memory block or a null pointer.
protected: virtual void setConstruct(bool flag);
Sets the object constructed flag.
Parameters:
flag — constructed flag.









