Skip to content

Commit

Permalink
Аксессоры в MemBlock приведены к соглашению
Browse files Browse the repository at this point in the history
  • Loading branch information
ava57r committed Mar 28, 2018
1 parent 6a11e99 commit 9e1b089
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/tool1cd/Class_1CD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool T_1CD::get_block(void* buf, uint32_t block_number, int32_t blocklen)
.add_detail("Всего блоков", to_hex_string(length));
}

memcpy(buf, memBlockManager.getblock(block_number), blocklen);
memcpy(buf, memBlockManager.get_block(block_number), blocklen);
return true;
}

Expand All @@ -62,7 +62,7 @@ char* T_1CD::get_block(uint32_t block_number) const
.add_detail("Всего блоков", to_hex_string(length));
}

return memBlockManager.getblock(block_number);
return memBlockManager.get_block(block_number);
}

//---------------------------------------------------------------------------
Expand All @@ -88,7 +88,7 @@ char* T_1CD::get_block_for_write(uint32_t block_number, bool read)
bc->length = length;
}

return memBlockManager.getblock_for_write(block_number, read);
return memBlockManager.get_block_for_write(block_number, read);
}

//---------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/tool1cd/MemBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ void MemBlockManager::garbage(bool aggressive)
}

//---------------------------------------------------------------------------
char* MemBlockManager::getblock(uint32_t _numblock)
char* MemBlockManager::get_block(uint32_t _numblock)
{
if(_numblock >= memblocks.size()) return nullptr;
if (!memblocks[_numblock]) {
memblocks[_numblock] = MemBlock::create(fs, pagesize, _numblock, false, true);
}
return memblocks[_numblock]->getblock(false);
return memblocks[_numblock]->get_block(false);
}

//---------------------------------------------------------------------------
char* MemBlockManager::getblock_for_write(uint32_t _numblock, bool read)
char* MemBlockManager::get_block_for_write(uint32_t _numblock, bool read)
{
if (_numblock > memblocks.size()) {
return nullptr;
Expand All @@ -97,7 +97,7 @@ char* MemBlockManager::getblock_for_write(uint32_t _numblock, bool read)
if(!memblocks[_numblock]) {
memblocks[_numblock] = MemBlock::create(fs, pagesize, _numblock, true, read);
}
return memblocks[_numblock]->getblock(true);
return memblocks[_numblock]->get_block(true);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -170,7 +170,7 @@ MemBlockManager::MemBlockManager()

}

char *MemBlock::getblock(bool for_write)
char *MemBlock::get_block(bool for_write)
{
if (for_write) {
changed = true;
Expand All @@ -179,7 +179,7 @@ char *MemBlock::getblock(bool for_write)
return data.data();
}

const char *MemBlock::getblock() const
const char *MemBlock::get_block() const
{
last_data_get = GetTickCount();
return data.data();
Expand Down
8 changes: 4 additions & 4 deletions src/tool1cd/MemBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class MemBlock
data.resize(page_size);
}

char *getblock(bool for_write);
char *get_block(bool for_write);

const char *getblock() const;
const char *get_block() const;

void write(std::shared_ptr<TFileStream> &fs);

Expand Down Expand Up @@ -57,8 +57,8 @@ class MemBlockManager
uint32_t count; // текущее количество кешированных блоков

void garbage(bool aggressive);
char* getblock(uint32_t _numblock);
char* getblock_for_write(uint32_t _numblock, bool read);
char* get_block(uint32_t _numblock);
char* get_block_for_write(uint32_t _numblock, bool read);
void create_memblocks(uint64_t _numblocks);

void delete_memblocks();
Expand Down

0 comments on commit 9e1b089

Please sign in to comment.