Skip to content
Snippets Groups Projects
Commit 26f56cee authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

add add_channel to annot sent

parent 12ecc683
Branches
No related merge requests found
......@@ -96,6 +96,19 @@ public:
return i->second;
}
/**
* Add a copy of the given annotation channel.
* If a channel of the given name already exists, will do nothing and return false.
* Otherwise, will add the channel and return true.
*/
bool add_channel(const std::string& name, const AnnotationChannel& chan) {
if (has_channel(name)) {
return false;
}
channels_.insert(std::make_pair(name, chan));
return true;
}
const chan_map_t& all_channels() const {
return channels_;
}
......
......@@ -49,6 +49,7 @@ namespace Corpus2 {
AnnotationChannel& get_channel(const std::string& name);
const AnnotationChannel& get_channel(const std::string& name) const;
bool add_channel(const std::string& name, const AnnotationChannel& chan);
const chan_map_t& all_channels() const;
/* --------------------------------------------------------------------- */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment