本文整理汇总了C++中setCodeInvalidated函数的典型用法代码示例。如果您正苦于以下问题:C++ setCodeInvalidated函数的具体用法?C++ setCodeInvalidated怎么用?C++ setCodeInvalidated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCodeInvalidated函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exception
void Constraint::removeExcludeElement(unsigned elem_idx)
{
if(elem_idx >= excl_elements.size())
throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
excl_elements.erase(excl_elements.begin() + elem_idx);
setCodeInvalidated(true);
}
示例2: Exception
void BaseObject::setPrependedSQL(const QString &sql)
{
if(!acceptsCustomSQL())
throw Exception(ERR_ASG_APPSQL_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(this->prepended_sql != sql);
this->prepended_sql=sql;
}
示例3: Exception
void Type::removeEnumeration(unsigned enum_idx)
{
if(enum_idx >= enumerations.size())
throw Exception(ERR_REF_ENUM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
enumerations.erase(enumerations.begin() + enum_idx);
setCodeInvalidated(true);
}
示例4: setCodeInvalidated
void Table::setCopyTable(Table *tab)
{
setCodeInvalidated(copy_table != tab);
copy_table=tab;
if(!copy_table)
copy_op=CopyOptions(0,0);
}
示例5: setCodeInvalidated
void View::removeReferences(void)
{
references.clear();
exp_select.clear();
exp_from.clear();
exp_where.clear();
setCodeInvalidated(true);
}
示例6: Exception
void Domain::setConstraintName(const QString &constr_name)
{
//Raises an error if the constraint name is invalid
if(!constr_name.isEmpty() && !BaseObject::isValidName(constr_name))
throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(constraint_name != constr_name);
this->constraint_name=constr_name;
}
示例7: Exception
void Role::setOption(unsigned op_type, bool value)
{
if(op_type > OP_REPLICATION)
//Raises an error if the option type is invalid
throw Exception(ERR_ASG_VAL_INV_ROLE_OPT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(options[op_type] != value);
options[op_type]=value;
}
示例8: Exception
void Cast::setCastType(unsigned cast_type)
{
//Raises an error if the user tries to assign an invalid cast type
if(cast_type!=ASSIGNMENT && cast_type!=IMPLICIT)
throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(this->cast_type != cast_type);
this->cast_type=cast_type;
}
示例9: Exception
void Column::setType(PgSQLType type)
{
//An error is raised if the column receive a pseudo-type as data type.
if(type.isPseudoType())
throw Exception(ERR_ASG_PSDTYPE_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(this->type != type);
this->type=type;
}
示例10: Exception
void View::addReference(Reference &refer, unsigned sql_type, int expr_id)
{
int idx;
vector<unsigned> *expr_list=nullptr;
Column *col=nullptr;
//Specific tests for expressions used as view definition
if(sql_type==Reference::SQL_VIEW_DEFINITION)
{
//Raises an error if the expression is empty
if(refer.getExpression().isEmpty())
throw Exception(ERR_INV_VIEW_DEF_EXPRESSION,__PRETTY_FUNCTION__,__FILE__,__LINE__);
//Raises an error if already exists a definition expression
else if(hasDefinitionExpression())
throw Exception(ERR_ASG_SEC_VIEW_DEF_EXPRESSION,__PRETTY_FUNCTION__,__FILE__,__LINE__);
//Raises an error if the user try to add a definition expression when already exists another references
else if(!references.empty())
throw Exception(ERR_MIX_VIEW_DEF_EXPR_REFS,__PRETTY_FUNCTION__,__FILE__,__LINE__);
}
//Raises an error if the user try to add a ordinary reference when there is a reference used as definition expression
else if(hasDefinitionExpression())
throw Exception(ERR_MIX_VIEW_DEF_EXPR_REFS,__PRETTY_FUNCTION__,__FILE__,__LINE__);
//Checks if the reference already exists
idx=getReferenceIndex(refer);
//If not exists
if(idx < 0)
{
//Inserts the reference on the view
refer.setDefinitionExpression(sql_type==Reference::SQL_VIEW_DEFINITION);
references.push_back(refer);
idx=references.size()-1;
}
if(sql_type!=Reference::SQL_VIEW_DEFINITION)
{
//Gets the expression list
expr_list=getExpressionList(sql_type);
//Inserts the reference id on the expression list
if(expr_id >= 0 && expr_id < static_cast<int>(expr_list->size()))
expr_list->insert(expr_list->begin() + expr_id, static_cast<unsigned>(idx));
//Raises an error if the expression id is invalid
else if(expr_id >= 0 && expr_id >= static_cast<int>(expr_list->size()))
throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
else
expr_list->push_back(static_cast<unsigned>(idx));
col=refer.getColumn();
if(col && col->isAddedByRelationship() &&
col->getObjectId() > this->object_id)
this->object_id=BaseObject::getGlobalId();
}
setCodeInvalidated(true);
}
示例11: Exception
void Permission::removeRole(unsigned role_idx)
{
if(role_idx > roles.size())
throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
roles.erase(roles.begin() + role_idx);
generatePermissionId();
setCodeInvalidated(true);
}
示例12: Exception
void Function::setSymbol(const QString &symbol)
{
if(language->getName().toLower()!=~LanguageType("c"))
throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_REFLIB_LANG_NOT_C)
.arg(this->getSignature()),
ERR_ASG_FUNC_REFLIB_LANG_NOT_C,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(this->symbol != symbol);
this->symbol=symbol;
}
示例13: Exception
void Function::setLibrary(const QString &library)
{
if(language->getName().toLower()!=~LanguageType("c"))
throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_REFLIB_LANG_NOT_C)
.arg(/*Utf8String::create(*/this->getSignature()),
ERR_ASG_FUNC_REFLIB_LANG_NOT_C,__PRETTY_FUNCTION__,__FILE__,__LINE__);
setCodeInvalidated(this->library != library);
this->library=library;
}
示例14: Exception
void EventTrigger::setFilter(const QString &variable, const QStringList &values)
{
if(variable.toLower()!=ParsersAttributes::TAG)
throw Exception(Exception::getErrorMessage(ERR_ASG_INV_EVENT_TRIGGER_VARIABLE).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__);
if(!values.isEmpty())
{
filter[variable].append(values);
setCodeInvalidated(true);
}
}
示例15: Exception
void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2)
{
vector<TableObject *> *obj_list=nullptr;
vector<TableObject *>::iterator itr1, itr2;
TableObject *aux_obj=nullptr, *aux_obj1=nullptr;
try
{
if(idx1!=idx2)
{
obj_list=getObjectList(obj_type);
//Raises an error if both index is out of list bounds
if(idx1 >= obj_list->size() && idx2 >= obj_list->size())
throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
//If the idx1 is out of bound inserts the element idx2 at the list's begin
else if(idx1 >= obj_list->size())
{
aux_obj1=obj_list->front();
itr2=obj_list->begin() + idx2;
aux_obj=(*itr2);
obj_list->erase(itr2);
obj_list->insert(obj_list->begin(), aux_obj);
}
//If the idx2 is out of bound inserts the element idx1 on the list's end
else if(idx2 >= obj_list->size())
{
itr1=obj_list->begin() + idx1;
aux_obj=(*itr1);
aux_obj1=obj_list->back();
obj_list->erase(itr1);
obj_list->push_back(aux_obj);
}
else
{
aux_obj=obj_list->at(idx1);
itr1=obj_list->begin() + idx1;
itr2=obj_list->begin() + idx2;
(*itr1)=aux_obj1=(*itr2);
(*itr2)=aux_obj;
}
if(obj_type!=OBJ_COLUMN && obj_type!=OBJ_CONSTRAINT)
BaseObject::swapObjectsIds(aux_obj, aux_obj1, false);
setCodeInvalidated(true);
}
}
catch(Exception &e)
{
throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e);
}
}