diff options
Diffstat (limited to 'kig/objects/object_calcer.cc')
-rw-r--r-- | kig/objects/object_calcer.cc | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kig/objects/object_calcer.cc b/kig/objects/object_calcer.cc index 40545ed1..ae442aae 100644 --- a/kig/objects/object_calcer.cc +++ b/kig/objects/object_calcer.cc @@ -29,8 +29,8 @@ void ObjectTypeCalcer::calc( const KigDocument& doc ) { Args a; - a.reserve( mparents.size() ); - std::transform( mparents.begin(), mparents.end(), + a.reserve( mtqparents.size() ); + std::transform( mtqparents.begin(), mtqparents.end(), std::back_inserter( a ), std::mem_fun( &ObjectCalcer::imp ) ); ObjectImp* n = mtype->calc( a, doc ); delete mimp; @@ -38,10 +38,10 @@ void ObjectTypeCalcer::calc( const KigDocument& doc ) } ObjectTypeCalcer::ObjectTypeCalcer( const ObjectType* type, - const std::vector<ObjectCalcer*>& parents, bool sort ) - : mparents( ( sort )?type->sortArgs( parents ):parents ), mtype( type ), mimp( 0 ) + const std::vector<ObjectCalcer*>& tqparents, bool sort ) + : mtqparents( ( sort )?type->sortArgs( tqparents ):tqparents ), mtype( type ), mimp( 0 ) { - std::for_each( mparents.begin(), mparents.end(), + std::for_each( mtqparents.begin(), mtqparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); } @@ -68,9 +68,9 @@ void ObjectConstCalcer::calc( const KigDocument& ) { } -std::vector<ObjectCalcer*> ObjectConstCalcer::parents() const +std::vector<ObjectCalcer*> ObjectConstCalcer::tqparents() const { - // we have no parents.. + // we have no tqparents.. return std::vector<ObjectCalcer*>(); } @@ -99,29 +99,29 @@ const ObjectImp* ObjectTypeCalcer::imp() const return mimp; } -std::vector<ObjectCalcer*> ObjectTypeCalcer::parents() const +std::vector<ObjectCalcer*> ObjectTypeCalcer::tqparents() const { - return mparents; + return mtqparents; } void ObjectCalcer::addChild( ObjectCalcer* c ) { - mchildren.push_back( c ); + mtqchildren.push_back( c ); ref(); } void ObjectCalcer::delChild( ObjectCalcer* c ) { - std::vector<ObjectCalcer*>::iterator i = std::find( mchildren.begin(), mchildren.end(), c ); - assert( i != mchildren.end() ); + std::vector<ObjectCalcer*>::iterator i = std::find( mtqchildren.begin(), mtqchildren.end(), c ); + assert( i != mtqchildren.end() ); - mchildren.erase( i ); + mtqchildren.erase( i ); deref(); } ObjectTypeCalcer::~ObjectTypeCalcer() { - std::for_each( mparents.begin(), mparents.end(), + std::for_each( mtqparents.begin(), mtqparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); delete mimp; } @@ -131,21 +131,21 @@ const ObjectType* ObjectTypeCalcer::type() const return mtype; } -ObjectPropertyCalcer::ObjectPropertyCalcer( ObjectCalcer* parent, int propid ) - : mimp( 0 ), mparent( parent ), mpropid( propid ) +ObjectPropertyCalcer::ObjectPropertyCalcer( ObjectCalcer* tqparent, int propid ) + : mimp( 0 ), mtqparent( tqparent ), mpropid( propid ) { // Some weird C++ thing prevents me from calling protected members - // of ObjectCalcer on mparent.. This is an ugly workaround.. - ( mparent->*&ObjectCalcer::addChild )( this ); - //mparent->addChild( this ); + // of ObjectCalcer on mtqparent.. This is an ugly workaround.. + ( mtqparent->*&ObjectCalcer::addChild )( this ); + //mtqparent->addChild( this ); } ObjectPropertyCalcer::~ObjectPropertyCalcer() { // Some weird C++ thing prevents me from calling protected members - // of ObjectCalcer on mparent.. This is an ugly workaround.. - ( mparent->*&ObjectCalcer::delChild )( this ); - //mparent->delChild( this ); + // of ObjectCalcer on mtqparent.. This is an ugly workaround.. + ( mtqparent->*&ObjectCalcer::delChild )( this ); + //mtqparent->delChild( this ); delete mimp; } @@ -154,16 +154,16 @@ const ObjectImp* ObjectPropertyCalcer::imp() const return mimp; } -std::vector<ObjectCalcer*> ObjectPropertyCalcer::parents() const +std::vector<ObjectCalcer*> ObjectPropertyCalcer::tqparents() const { std::vector<ObjectCalcer*> ret; - ret.push_back( mparent ); + ret.push_back( mtqparent ); return ret; } void ObjectPropertyCalcer::calc( const KigDocument& doc ) { - ObjectImp* n = mparent->imp()->property( mpropid, doc ); + ObjectImp* n = mtqparent->imp()->property( mpropid, doc ); delete mimp; mimp = n; } @@ -175,15 +175,15 @@ ObjectImp* ObjectConstCalcer::switchImp( ObjectImp* newimp ) return ret; } -std::vector<ObjectCalcer*> ObjectCalcer::children() const +std::vector<ObjectCalcer*> ObjectCalcer::tqchildren() const { - return mchildren; + return mtqchildren; } const ObjectImpType* ObjectPropertyCalcer::impRequirement( ObjectCalcer*, const std::vector<ObjectCalcer*>& ) const { - return mparent->imp()->impRequirementForProperty( mpropid ); + return mtqparent->imp()->impRequirementForProperty( mpropid ); } const ObjectImpType* ObjectConstCalcer::impRequirement( @@ -197,12 +197,12 @@ const ObjectImpType* ObjectTypeCalcer::impRequirement( ObjectCalcer* o, const std::vector<ObjectCalcer*>& os ) const { Args args; - args.reserve( mparents.size() ); + args.reserve( mtqparents.size() ); std::transform( os.begin(), os.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); - assert( std::find( args.begin(), args.end(), o->imp() ) != args.end() ); + assert( std::tqfind( args.begin(), args.end(), o->imp() ) != args.end() ); return mtype->impRequirement( o->imp(), args ); } @@ -220,9 +220,9 @@ void ObjectTypeCalcer::setParents( const std::vector<ObjectCalcer*> np ) { std::for_each( np.begin(), np.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); - std::for_each( mparents.begin(), mparents.end(), + std::for_each( mtqparents.begin(), mtqparents.end(), std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); - mparents = np; + mtqparents = np; } void ObjectTypeCalcer::setType( const ObjectType* t ) @@ -270,15 +270,15 @@ void ObjectTypeCalcer::move( const Coordinate& to, const KigDocument& doc ) { // we need to check if type can in fact move, because this check is // not done for us in all circumstances ( e.g. LineABType::move uses - // move on its parents to move them ), and the ObjectType's depend + // move on its tqparents to move them ), and the ObjectType's depend // on move only being called if canMove() returns true.. if ( mtype->canMove( *this ) ) mtype->move( *this, to, doc ); } -ObjectCalcer* ObjectPropertyCalcer::parent() const +ObjectCalcer* ObjectPropertyCalcer::tqparent() const { - return mparent; + return mtqparent; } ObjectCalcer::ObjectCalcer() @@ -303,16 +303,16 @@ bool ObjectConstCalcer::isDefinedOnOrThrough( const ObjectCalcer* ) const bool ObjectPropertyCalcer::isDefinedOnOrThrough( const ObjectCalcer* o ) const { - return o == mparent && - mparent->imp()->isPropertyDefinedOnOrThroughThisImp( propId() ); + return o == mtqparent && + mtqparent->imp()->isPropertyDefinedOnOrThroughThisImp( propId() ); } bool ObjectTypeCalcer::isDefinedOnOrThrough( const ObjectCalcer* o ) const { Args args; - args.reserve( mparents.size() ); + args.reserve( mtqparents.size() ); std::transform( - mparents.begin(), mparents.end(), + mtqparents.begin(), mtqparents.end(), std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); if ( std::find( args.begin(), args.end(), o->imp() ) == args.end() ) |