Permalink
Browse files

pgsqltypes files refactoring checkpoint.

  • Loading branch information...
1 parent b20a205 commit c0c7a410f50990c85dea8e513d9ec15e4ce347f5 @rkhaotix rkhaotix committed Dec 18, 2012
Showing with 489 additions and 495 deletions.
  1. +15 −15 libobjrenderer/src/ogsubitemobjeto.cpp
  2. +1 −1 libobjrenderer/src/ogsubitemobjeto.h
  3. +14 −14 libpgmodeler/src/constraint.cpp
  4. +3 −3 libpgmodeler/src/constraint.h
  5. +2 −2 libpgmodeler/src/function.cpp
  6. +3 −3 libpgmodeler/src/function.h
  7. +2 −2 libpgmodeler/src/index.cpp
  8. +3 −3 libpgmodeler/src/index.h
  9. +39 −39 libpgmodeler/src/modelobd.cpp
  10. +2 −2 libpgmodeler/src/operationlist.cpp
  11. +2 −2 libpgmodeler/src/operatorclass.cpp
  12. +3 −3 libpgmodeler/src/operatorclass.h
  13. +2 −2 libpgmodeler/src/operatorfamily.cpp
  14. +3 −3 libpgmodeler/src/operatorfamily.h
  15. +179 −179 libpgmodeler/src/pgsqltypes.cpp
  16. +96 −102 libpgmodeler/src/pgsqltypes.h
  17. +12 −12 libpgmodeler/src/relationship.cpp
  18. +4 −4 libpgmodeler/src/rule.cpp
  19. +6 −6 libpgmodeler/src/rule.h
  20. +11 −11 libpgmodeler/src/tabela.cpp
  21. +1 −1 libpgmodeler/src/tabela.h
  22. +9 −9 libpgmodeler/src/trigger.cpp
  23. +3 −3 libpgmodeler/src/trigger.h
  24. +2 −2 libpgmodeler_ui/src/classeoperadoreswidget.cpp
  25. +1 −1 libpgmodeler_ui/src/colunawidget.cpp
  26. +2 −2 libpgmodeler_ui/src/familiaoperadoreswidget.cpp
  27. +1 −1 libpgmodeler_ui/src/funcaowidget.cpp
  28. +8 −8 libpgmodeler_ui/src/gatilhowidget.cpp
  29. +3 −3 libpgmodeler_ui/src/indicewidget.cpp
  30. +6 −6 libpgmodeler_ui/src/modelowidget.cpp
  31. +4 −4 libpgmodeler_ui/src/regrawidget.cpp
  32. +26 −26 libpgmodeler_ui/src/restricaowidget.cpp
  33. +7 −7 libpgmodeler_ui/src/tabelawidget.cpp
  34. +7 −7 libpgmodeler_ui/src/tipopgsqlwidget.cpp
  35. +2 −2 libpgmodeler_ui/src/tipopgsqlwidget.h
  36. +5 −5 libpgmodeler_ui/src/visaoobjetoswidget.cpp
@@ -35,7 +35,7 @@ OGSubItemObjeto::~OGSubItemObjeto(void)
}
}
-void OGSubItemObjeto::configurarDescritor(TipoRestricao tipo_rest)
+void OGSubItemObjeto::configurarDescritor(ConstraintType tipo_rest)
{
ObjectType tipo_obj=BASE_OBJECT;
Column *coluna=dynamic_cast<Column *>(this->obterObjetoOrigem());
@@ -105,7 +105,7 @@ void OGSubItemObjeto::configurarDescritor(TipoRestricao tipo_rest)
QGraphicsPolygonItem *desc=dynamic_cast<QGraphicsPolygonItem *>(descritor);
//Cria um polígono conforme o tipo de restrição da coluna
- if(tipo_rest==TipoRestricao::primary_key)
+ if(tipo_rest==ConstraintType::primary_key)
{
atrib=ParsersAttributes::PK_COLUMN;
pol.append(QPointF(2,0)); pol.append(QPointF(0,2)); pol.append(QPointF(0,7));
@@ -114,15 +114,15 @@ void OGSubItemObjeto::configurarDescritor(TipoRestricao tipo_rest)
pol.append(QPointF(7,5)); pol.append(QPointF(9,7)); pol.append(QPointF(9,3));
pol.append(QPointF(3,3)); pol.append(QPointF(3,1));
}
- else if(tipo_rest==TipoRestricao::foreign_key)
+ else if(tipo_rest==ConstraintType::foreign_key)
{
atrib=ParsersAttributes::FK_COLUMN;
pol.append(QPointF(0,3)); pol.append(QPointF(0,6)); pol.append(QPointF(4,6));
pol.append(QPointF(4,9)); pol.append(QPointF(5,9)); pol.append(QPointF(9,5));
pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); pol.append(QPointF(4,0));
pol.append(QPointF(4,3));
}
- else if(tipo_rest==TipoRestricao::unique)
+ else if(tipo_rest==ConstraintType::unique)
{
atrib=ParsersAttributes::UQ_COLUMN;
pol.append(QPointF(4,0)); pol.append(QPointF(0,4)); pol.append(QPointF(0,5));
@@ -184,7 +184,7 @@ void OGSubItemObjeto::configurarObjeto(void)
QString str_rest;
TableObject *objeto_tab=dynamic_cast<TableObject *>(this->obterObjetoOrigem());
Column *coluna=dynamic_cast<Column *>(objeto_tab);
- TipoRestricao tipo_rest=TipoRestricao::null;
+ ConstraintType tipo_rest=ConstraintType::null;
//Caso seja uma coluna
if(coluna)
@@ -198,17 +198,17 @@ void OGSubItemObjeto::configurarObjeto(void)
if(str_rest.find(TEXTO_PRIMARY_KEY)>=0)
{
fmt=config_fonte[ParsersAttributes::PK_COLUMN];
- tipo_rest=TipoRestricao::primary_key;
+ tipo_rest=ConstraintType::primary_key;
}
else if(str_rest.find(TEXTO_FOREIGN_KEY)>=0)
{
fmt=config_fonte[ParsersAttributes::FK_COLUMN];
- tipo_rest=TipoRestricao::foreign_key;
+ tipo_rest=ConstraintType::foreign_key;
}
else if(str_rest.find(TEXTO_UNIQUE)>=0)
{
fmt=config_fonte[ParsersAttributes::UQ_COLUMN];
- tipo_rest=TipoRestricao::unique;
+ tipo_rest=ConstraintType::unique;
}
else if(str_rest.find(TEXTO_NOT_NULL)>=0)
fmt=config_fonte[ParsersAttributes::NN_COLUMN];
@@ -277,10 +277,10 @@ void OGSubItemObjeto::configurarObjeto(void)
str_rest+=(~gatilho->getFiringType()).mid(0,1);
str_rest+=SEPARADOR_REST;
- for(unsigned i=TipoEvento::on_insert; i < TipoEvento::on_truncate; i++)
+ for(unsigned i=EventType::on_insert; i < EventType::on_truncate; i++)
{
- if(gatilho->isExecuteOnEvent(TipoEvento(i)))
- str_rest+=(~TipoEvento(i)).mid(3,1);
+ if(gatilho->isExecuteOnEvent(EventType(i)))
+ str_rest+=(~EventType(i)).mid(3,1);
}
str_rest=str_rest.lower();
}
@@ -428,7 +428,7 @@ QString OGSubItemObjeto::obterStringRestricoes(Column *coluna)
Constraint *restricao=NULL;
vector<Constraint *>::iterator itr,itr_end;
vector<Constraint *> restricoes;
- TipoRestricao tipo_rest;
+ ConstraintType tipo_rest;
unsigned i, qtd;
qtd=tabela->obterNumRestricoes();
@@ -452,11 +452,11 @@ QString OGSubItemObjeto::obterStringRestricoes(Column *coluna)
//Para cada tipo de constraint concatena-se o texto referente
// a mesma e um separadar de textos de constraints
- if(tipo_rest==TipoRestricao::primary_key)
+ if(tipo_rest==ConstraintType::primary_key)
str_rest=TEXTO_PRIMARY_KEY + SEPARADOR_REST;
- else if(tipo_rest==TipoRestricao::foreign_key)
+ else if(tipo_rest==ConstraintType::foreign_key)
str_rest+=TEXTO_FOREIGN_KEY + SEPARADOR_REST;
- else if(tipo_rest==TipoRestricao::unique)
+ else if(tipo_rest==ConstraintType::unique)
str_rest+=TEXTO_UNIQUE + SEPARADOR_REST;
}
}
@@ -56,7 +56,7 @@ class OGSubItemObjeto: public ObjetoGrafico
TEXTO_UNIQUE;
//Configura o descritor do subitem conforme o tipo do objeto de origem
- void configurarDescritor(TipoRestricao tipo_rest=BaseType::null);
+ void configurarDescritor(ConstraintType tipo_rest=BaseType::null);
/* Sobrecarga do método da classe QGraphicsItemGroup::itemChange() e sua implentação
controla as alterações durante a seleção e movimentação do objeto. Esta nova implementação
@@ -31,7 +31,7 @@ Constraint::~Constraint(void)
removeColumns();
}
-void Constraint::setConstraintType(TipoRestricao constr_type)
+void Constraint::setConstraintType(ConstraintType constr_type)
{
this->constr_type=constr_type;
}
@@ -90,7 +90,7 @@ void Constraint::addColumn(Column *column, unsigned col_type)
.arg(QString::fromUtf8(this->getName()))
.arg(BaseObject::getTypeName(OBJ_CONSTRAINT)),
ERR_ASG_NOT_ALOC_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__);
- else if(constr_type!=TipoRestricao::check)
+ else if(constr_type!=ConstraintType::check)
{
//Adds the column only if the column doesn't exists on the internal list
if(!isColumnExists(column,col_type))
@@ -108,8 +108,8 @@ void Constraint::setTablespace(Tablespace *tabspc)
try
{
if(tabspc &&
- constr_type!=TipoRestricao::primary_key &&
- constr_type!=TipoRestricao::unique)
+ constr_type!=ConstraintType::primary_key &&
+ constr_type!=ConstraintType::unique)
throw Exception(ERR_ASG_TABSPC_INV_CONSTR_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__);
BaseObject::setTablespace(tabspc);
@@ -194,7 +194,7 @@ unsigned Constraint::getFillFactor(void)
return(fill_factor);
}
-TipoRestricao Constraint::getConstraintType(void)
+ConstraintType Constraint::getConstraintType(void)
{
return(constr_type);
}
@@ -356,16 +356,16 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel)
switch(!constr_type)
{
- case TipoRestricao::check:
+ case ConstraintType::check:
attrib=ParsersAttributes::CK_CONSTR;
break;
- case TipoRestricao::primary_key:
+ case ConstraintType::primary_key:
attrib=ParsersAttributes::PK_CONSTR;
break;
- case TipoRestricao::foreign_key:
+ case ConstraintType::foreign_key:
attrib=ParsersAttributes::FK_CONSTR;
break;
- case TipoRestricao::unique:
+ case ConstraintType::unique:
attrib=ParsersAttributes::UQ_CONSTR;
break;
}
@@ -376,7 +376,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel)
attributes[ParsersAttributes::DEL_ACTION]=(~del_action);
attributes[ParsersAttributes::EXPRESSION]=check_expr;
- if(constr_type!=TipoRestricao::check)
+ if(constr_type!=ConstraintType::check)
{
setColumnsAttribute(SOURCE_COLS, def_type, inc_addedbyrel);
@@ -385,7 +385,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel)
this means the constraint is configured correctly, otherwise don't generates
the attribute forcing the schema parser to return an error because the foreign key is
misconfigured. */
- if(constr_type==TipoRestricao::foreign_key && columns.size() == ref_columns.size())
+ if(constr_type==ConstraintType::foreign_key && columns.size() == ref_columns.size())
setColumnsAttribute(REFERENCED_COLS, def_type, inc_addedbyrel);
}
@@ -401,11 +401,11 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel)
inside the parent table construction by the use of 'decl-in-table' schema attribute.
Note: For reference track reason foreign keys ALWAYS will be created in a separeted (ALTER TABLE)
command outside the parent table declaration */
- if(constr_type!=TipoRestricao::foreign_key &&
- (!isReferRelationshipColumn() || constr_type==TipoRestricao::primary_key))
+ if(constr_type!=ConstraintType::foreign_key &&
+ (!isReferRelationshipColumn() || constr_type==ConstraintType::primary_key))
attributes[ParsersAttributes::DECL_IN_TABLE]="1";
- if(constr_type==TipoRestricao::primary_key || constr_type==TipoRestricao::unique)
+ if(constr_type==ConstraintType::primary_key || constr_type==ConstraintType::unique)
attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor);
else
attributes[ParsersAttributes::FACTOR]="";
@@ -30,7 +30,7 @@
class Constraint: public TableObject{
private:
//Type of the constraint (primary key, foreign key, unique or check)
- TipoRestricao constr_type;
+ ConstraintType constr_type;
//Indicates if the constraint is deferrable (only for foreign key)
bool deferrable;
@@ -83,7 +83,7 @@ class Constraint: public TableObject{
void addColumn(Column *column, unsigned col_type);
//Defines the constraint type
- void setConstraintType(TipoRestricao constr_type);
+ void setConstraintType(ConstraintType constr_type);
/* Defines the type of action on foreign keys (ON DELETE and ON UPDATE).
If the parameter 'upd' is set, it will be configured the action on update
@@ -138,7 +138,7 @@ class Constraint: public TableObject{
void removeColumns(void);
//Returns the constraint type
- TipoRestricao getConstraintType(void);
+ ConstraintType getConstraintType(void);
//Returns the check expression
QString getCheckExpression(void);
@@ -232,7 +232,7 @@ void Function::setReturnType(TipoPgSQL type)
return_type=type;
}
-void Function::setFunctionType(TipoFuncao func_type)
+void Function::setFunctionType(FunctionType func_type)
{
function_type=func_type;
}
@@ -284,7 +284,7 @@ TipoPgSQL Function::getReturnType(void)
return(return_type);
}
-TipoFuncao Function::getFunctionType(void)
+FunctionType Function::getFunctionType(void)
{
return(function_type);
}
@@ -83,7 +83,7 @@ class Function: public BaseObject {
TipoComportamento behavior_type;
//Function type. It can be VOLATILE, IMMUTABLE, STABLE
- TipoFuncao function_type;
+ FunctionType function_type;
//Function return type
TipoPgSQL return_type;
@@ -151,7 +151,7 @@ class Function: public BaseObject {
void setBehaviorType(TipoComportamento behav_type);
//Defines the function type (VOLATILE, IMMUTABLE, STABLE)
- void setFunctionType(TipoFuncao func_type);
+ void setFunctionType(FunctionType func_type);
//Defines the function return type
void setReturnType(TipoPgSQL type);
@@ -196,7 +196,7 @@ class Function: public BaseObject {
TipoComportamento getBehaviorType(void);
//Returns the function type
- TipoFuncao getFunctionType(void);
+ FunctionType getFunctionType(void);
//Returns the function returned type
TipoPgSQL getReturnType(void);
@@ -158,7 +158,7 @@ void Index::setFillFactor(unsigned factor)
fill_factor=factor;
}
-void Index::setIndexingType(TipoIndexacao idx_type)
+void Index::setIndexingType(IndexingType idx_type)
{
this->indexing_type=idx_type;
}
@@ -195,7 +195,7 @@ bool Index::getIndexAttribute(unsigned attrib_id)
return(index_attribs[attrib_id]);
}
-TipoIndexacao Index::getIndexingType(void)
+IndexingType Index::getIndexingType(void)
{
return(indexing_type);
}
View
@@ -37,7 +37,7 @@ class Index: public TableObject{
unsigned fill_factor;
//Indexing method used by the index
- TipoIndexacao indexing_type;
+ IndexingType indexing_type;
//Boolean attributes that define some index features (UNIQUE, CONCURRENT, FAST UPDATE)
bool index_attribs[3];
@@ -79,7 +79,7 @@ class Index: public TableObject{
void setConditionalExpression(const QString &expr);
//Defines the indexing method used by the index
- void setIndexingType(TipoIndexacao idx_type);
+ void setIndexingType(IndexingType idx_type);
/* Configures the attributes for the indexs. These attributes can be
referencede using the UNIQUE, CONCURRENT and FAST_UPDATE constants */
@@ -95,7 +95,7 @@ class Index: public TableObject{
unsigned getElementCount(void);
//Returns the indexing method used by the index
- TipoIndexacao getIndexingType(void);
+ IndexingType getIndexingType(void);
//Returns the current state of one index attribute (UNIQUE, CONCURRENT, FAST UPDATE)
bool getIndexAttribute(unsigned attrib_id);
Oops, something went wrong.

0 comments on commit c0c7a41

Please sign in to comment.