MCPcopy Create free account
hub / github.com/Kitware/VTK / AddIndexToTable

Method AddIndexToTable

IO/SQL/vtkSQLDatabaseSchema.cxx:192–207  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

190
191//------------------------------------------------------------------------------
192int vtkSQLDatabaseSchema::AddIndexToTable(int tblHandle, int idxType, const char* idxName)
193{
194 if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables())
195 {
196 vtkErrorMacro("Cannot add index to non-existent table " << tblHandle);
197 return -1;
198 }
199
200 int idxHandle = static_cast<int>(this->Internals->Tables[tblHandle].Indices.size());
201 this->Internals->Tables[tblHandle].Indices.resize(idxHandle + 1);
202 vtkSQLDatabaseSchemaInternals::Index* index =
203 &this->Internals->Tables[tblHandle].Indices[idxHandle];
204 index->Type = static_cast<DatabaseIndexType>(idxType);
205 index->Name = idxName;
206 return idxHandle;
207}
208
209//------------------------------------------------------------------------------
210int vtkSQLDatabaseSchema::AddTriggerToTable(

Callers 2

AddIndexToTableFunction · 0.80

Calls 3

GetNumberOfTablesMethod · 0.95
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected