SwatDB
data.h
Go to the documentation of this file.
1 /*
2  * SwatDB
3  *
4  * @authors: See Contributors.doc for code contributors
5  *
6  * Copyright (c) 2020 Swarthmore College Computer Science Department
7  * Swarthmore PA, Professors Tia Newhall, Ameet Soni
8  */
9 
10 #pragma once
11 
16 #include "swatdb_types.h"
17 
25 class Data {
26 
27  public:
28 
32  Data() = delete;
33 
37  Data(const Data& other) = delete;
38 
42  Data& operator=(const Data& other) = delete;
43 
52  Data(std::uint32_t size, const char* other_data);
53 
63  Data(std::uint32_t size, std::uint32_t capacity);
64 
72  Data(std::uint32_t capacity);
73 
80  ~Data();
81 
90  char* getData();
91 
100  std::uint32_t getSize();
101 
112  void setSize(std::uint32_t new_size);
113 
122  std::uint32_t getCapacity();
123 
124  private:
125 
129  char* data;
130 
134  std::uint32_t size;
135 
139  std::uint32_t capacity;
140 
141 };
Data & operator=(const Data &other)=delete
Disable copy assignment constructor.
char * getData()
Getter for data char array.
void setSize(std::uint32_t new_size)
Setter for size.
Data()=delete
Disable base constructor.
char * data
Definition: data.h:129
~Data()
Destructor.
std::uint32_t size
Definition: data.h:134
std::uint32_t capacity
Definition: data.h:139
Definition: data.h:25
std::uint32_t getCapacity()
Getter for capacity.
std::uint32_t getSize()
Getter for size.