forked from jdnc/nao-robots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.cpp
35 lines (29 loc) · 927 Bytes
/
Module.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "Module.h"
Module::Module():
memory_(NULL),
memory_satisfied_(true) // Assume it will work
{
}
void Module::init(Memory *memory, TextLogger* tl) {
memory_ = memory;
textlogger = tl;
specifyMemoryDependency();
specifyMemoryBlocks();
initSpecificModule();
}
void Module::updateModuleMemory(Memory *memory) {
memory_ = memory;
specifyMemoryBlocks();
}
void Module::requiresMemoryBlock(const std::string &name) {
//I commented this check out as it doesn't work well with the new getOrAdd commands (MQ 3/15/2011)
//MemoryBlock *block;
//memory_->getBlockByName(block,name);
//if (block == NULL)
// std::cerr << "Module::requiresMemoyBlock: ERROR: requiring memory block that does not exist: " << name << std::endl;
required_blocks_.push_back(name);
}
void Module::providesMemoryBlock(const std::string &name) {
required_blocks_.push_back(name);
provided_blocks_.push_back(name);
}