X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fftacmp%2Fparse_schema.h;fp=src%2Fftacmp%2Fparse_schema.h;h=45366a54e346ea343a7c242ea9625565534044dd;hb=7210c67dde90098460d1f0922deeb810be521673;hp=3c009ba36547384f9e56ab4833b012c0a64c4c39;hpb=cc56def24d5d4a66ce0880f782ac465fca799289;p=com%2Fgs-lite.git diff --git a/src/ftacmp/parse_schema.h b/src/ftacmp/parse_schema.h index 3c009ba..45366a5 100644 --- a/src/ftacmp/parse_schema.h +++ b/src/ftacmp/parse_schema.h @@ -326,6 +326,8 @@ private: param_list *base_tables; // if PROTOCOL, the PROTOCOLS that // this PROTOCOL inherits fields from. int schema_type; // STREAM_SCHEMA, PROTOCOL_SCHEMA, OPERATOR_VIEW_SCHEMA + int schema_id; // the id associated with the protocol + std::set all_schema_ids; // schema_id plus the inherited ones // For operator_view tables param_list *op_properties; std::vector qspec_list; @@ -343,10 +345,26 @@ public: // get the PROTOCOL-wide unpack functions. table_def(const char *name, param_list *plist, param_list *ufcn_l, field_entry_list *fel, int sch_t){ int f; - if(plist == NULL) + schema_id = -1; base_tables = new param_list(); - else - base_tables = plist; + if(plist != NULL){ + std::vector pkeys = plist->get_key_vec(); + for(int p=0;pval_of(pkeys[p]); + if(val!=""){ + if(pkeys[p] == "schema_id" || pkeys[p] == "schemaId"){ + schema_id = atoi(val.c_str()); + if(schema_id <= 0){ + fprintf(stderr,"Error, Protocol %s has a schema_id value of %d, must be larger than 0.\n",name, schema_id); + exit(1); + } + all_schema_ids.insert(schema_id); + } + }else{ + base_tables->append(pkeys[p]); + } + } + } table_name =name; fields = fel->get_list(); schema_type = sch_t; @@ -416,6 +434,14 @@ public: int get_schema_type(){return schema_type;}; + int get_schema_id(){return schema_id;}; + + std::set get_all_schema_ids(){ return all_schema_ids;} + void add_to_all_schema_ids(int sid){ + all_schema_ids.insert(sid); + } + + std::vector get_subqueryspecs(){return qspec_list;}; std::string to_string(); @@ -525,6 +551,10 @@ public: return(tbl_list[t]->get_schema_type()); }; + int get_schema_id(int t){ + return(tbl_list[t]->get_schema_id()); + }; + std::string get_op_prop(int t, std::string s){ return(tbl_list[t]->get_op_prop(s)); };