Tidy and rename all Ripple source files

This commit is contained in:
Vinnie Falco
2013-09-13 16:29:21 -07:00
parent 5be3a1a34d
commit 846b8e339c
221 changed files with 734 additions and 700 deletions

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
SOTemplate::SOTemplate ()
{
}
void SOTemplate::push_back (SOElement const& r)
{
// Ensure there is the enough space in the index mapping
// table for all possible fields.
//
if (mIndex.empty ())
{
// Unmapped indices will be set to -1
//
mIndex.resize (SField::getNumFields () + 1, -1);
}
// Make sure the field's index is in range
//
assert (r.e_field.getNum () < mIndex.size ());
// Make sure that this field hasn't already been assigned
//
assert (getIndex (r.e_field) == -1);
// Add the field to the index mapping table
//
mIndex [r.e_field.getNum ()] = mTypes.size ();
// Append the new element.
//
mTypes.push_back (new SOElement (r));
}
int SOTemplate::getIndex (SField::ref f) const
{
// The mapping table should be large enough for any possible field
//
assert (f.getNum () < mIndex.size ());
return mIndex[f.getNum ()];
}