From 9bd863c9002b525b7827f9158d9136143393be5c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 23 Jan 2017 11:49:51 -0500 Subject: Added verb frame parsing --- lib/group.h | 60 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'lib/group.h') diff --git a/lib/group.h b/lib/group.h index dd53503..fe62d39 100644 --- a/lib/group.h +++ b/lib/group.h @@ -6,82 +6,86 @@ #include #include "field.h" #include "filter.h" +#include "frame.h" +#include "role.h" struct sqlite3_stmt; namespace verbly { - + class database; - class frame; - + class group { public: - + // Default constructor - + group() = default; - + // Construct from database - + group(const database& db, sqlite3_stmt* row); - + // Accessors - + operator bool() const { return valid_; } - + int getId() const { if (!valid_) { throw std::domain_error("Bad access to uninitialized group"); } - + return id_; } - + const std::vector& getFrames() const; - + + const role& getRole(std::string roleName) const; + // Type info - + static const object objectType; - + static const std::list select; - + // Query fields - + static const field id; - + operator filter() const { if (!valid_) { throw std::domain_error("Bad access to uninitialized group"); } - + return (id == id_); } - + // Relationships to other objects - + static const field frame; - + static const field word; - + private: bool valid_ = false; - + int id_; - + std::map roles_; + const database* db_; - + mutable bool initializedFrames_ = false; mutable std::vector frames_; - + }; - + }; #endif /* end of include guard: GROUP_H_BD6933C0 */ -- cgit 1.4.1