Skip to content

Commit

Permalink
summary report: some minor renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmut committed Oct 17, 2016
1 parent fc73153 commit 8ca88b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions inc/vcf/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ namespace ebi
#pragma db object
struct NoMetaDefinitionError : public Error
{
private:
friend class odb::access;
NoMetaDefinitionError() {}
public:
NoMetaDefinitionError(size_t line,
const std::string &message,
Expand All @@ -192,6 +189,9 @@ namespace ebi
virtual void apply_visitor(ErrorVisitor &visitor) override { visitor.visit(*this); }
std::string column;
std::string field;
private:
friend class odb::access;
NoMetaDefinitionError() {}
};

// inheritance siblings about detailed errors
Expand Down Expand Up @@ -303,9 +303,6 @@ namespace ebi
#pragma db object
struct SamplesFieldBodyError : public BodySectionError
{
private:
friend class odb::access;
SamplesFieldBodyError() {} // necessary for ODB
public:
SamplesFieldBodyError(size_t line,
const std::string &message,
Expand All @@ -314,14 +311,17 @@ namespace ebi
: BodySectionError{line, message}, field{field}, field_cardinality{field_cardinality} {
if (field.empty()) {
throw std::invalid_argument{"SamplesFieldBodyError: field should not be an empty string. Use "
"SamplesBodyError for unknown errors in the samples columns"};
"SamplesBodyError for unknown errors in the samples columns"};
}
}
virtual ErrorCode get_code() const override { return ErrorCode::samples_field_body; }
virtual void apply_visitor(ErrorVisitor &visitor) override { visitor.visit(*this); }

std::string field;
long field_cardinality; // [0, inf): valid number of values. -1: unknown amount of values
private:
friend class odb::access;
SamplesFieldBodyError() {} // necessary for ODB
};
#pragma db object
struct NormalizationError : public BodySectionError
Expand Down
8 changes: 4 additions & 4 deletions inc/vcf/summary_report_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace ebi
class SummaryTracker : public ErrorVisitor
{
public:
SummaryTracker() : undefined_metadata{}, skip(false) {}
SummaryTracker() : already_reported{}, skip{false} {}

bool should_write_report(Error &error)
{
Expand Down Expand Up @@ -84,7 +84,7 @@ namespace ebi
bool is_already_reported(std::string const &meta_type, std::string const &id) const
{
typedef std::multimap<std::string,std::string>::const_iterator iter;
std::pair<iter, iter> range = undefined_metadata.equal_range(meta_type);
std::pair<iter, iter> range = already_reported.equal_range(meta_type);
for (auto & current = range.first; current != range.second; ++current) {
if (current->second == id) {
return true;
Expand All @@ -95,10 +95,10 @@ namespace ebi

void add_already_reported(std::string const &meta_type, std::string const &id)
{
undefined_metadata.emplace(meta_type, id);
already_reported.emplace(meta_type, id);
}

std::multimap<std::string, std::string> undefined_metadata;
std::multimap<std::string, std::string> already_reported;
bool skip;
};

Expand Down

0 comments on commit 8ca88b6

Please sign in to comment.