MCPcopy Create free account
hub / github.com/ImageEngine/cortex / convertIndex

Function convertIndex

src/IECorePython/ObjectVectorBinding.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61static std::vector<ObjectVector>::size_type convertIndex( ObjectVector &o, int64_t index )
62{
63 int64_t s = o.members().size();
64
65 if( index < 0 )
66 {
67 index += s;
68 }
69
70 if( index >= s || index < 0 )
71 {
72 PyErr_SetString( PyExc_IndexError, "Index out of range" );
73 throw_error_already_set();
74 }
75
76 return index;
77}
78
79static std::string repr( ObjectVector &o )
80{

Callers 3

getItemFunction · 0.85
setItemFunction · 0.85
delItemFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected