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

Method AddTriggerToTable

IO/SQL/vtkSQLDatabaseSchema.cxx:210–234  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

208
209//------------------------------------------------------------------------------
210int vtkSQLDatabaseSchema::AddTriggerToTable(
211 int tblHandle, int trgType, const char* trgName, const char* trgAction, const char* trgBackend)
212{
213 if (!trgName)
214 {
215 vtkErrorMacro("Cannot add trigger with empty name to table " << tblHandle);
216 return -1;
217 }
218
219 if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables())
220 {
221 vtkErrorMacro("Cannot add trigger to non-existent table " << tblHandle);
222 return -1;
223 }
224
225 int trgHandle = static_cast<int>(this->Internals->Tables[tblHandle].Triggers.size());
226 this->Internals->Tables[tblHandle].Triggers.resize(trgHandle + 1);
227 vtkSQLDatabaseSchemaInternals::Trigger* trigger =
228 &this->Internals->Tables[tblHandle].Triggers[trgHandle];
229 trigger->Type = static_cast<DatabaseTriggerType>(trgType);
230 trigger->Name = trgName;
231 trigger->Action = trgAction;
232 trigger->Backend = trgBackend;
233 return trgHandle;
234}
235
236//------------------------------------------------------------------------------
237int vtkSQLDatabaseSchema::AddOptionToTable(

Callers 2

AddTriggerToTableFunction · 0.80

Calls 3

GetNumberOfTablesMethod · 0.95
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected