refactor and reuse Automatas. TODO : add test for automatas

This commit is contained in:
IlyaShurupov 2024-02-06 17:18:19 +03:00 committed by Ilusha
parent 312419936e
commit 93b02416de
3 changed files with 166 additions and 318 deletions

View file

@ -317,12 +317,13 @@ namespace tp {
return *this;
}
void append(Arg data) {
tType& append(Arg data) {
if (mLoad == mSize) {
resizeBuffer(tResizePolicy(mSize));
}
new (&mBuff[mLoad]) tType(data);
mLoad++;
return mBuff[mLoad - 1];
}
void append(const Buffer& in) {

View file

@ -299,6 +299,14 @@ namespace tp {
}
}
void transferNodes(List in) {
removeAll();
for (auto node : in) {
attach(node);
}
in.detachAll();
}
public:
template <class tArchiver>
void archiveWrite(tArchiver& ar) const {