From: <ag...@us...> - 2011-09-06 17:30:17
|
Revision: 2471 http://zoolib.svn.sourceforge.net/zoolib/?rev=2471&view=rev Author: agreen Date: 2011-09-06 17:30:07 +0000 (Tue, 06 Sep 2011) Log Message: ----------- Put sCog prefix on cog-creating template functions. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCog.h Modified: trunk/zoolib/source/cxx/zoolib/ZCog.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-09-06 17:16:16 UTC (rev 2470) +++ trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-09-06 17:30:07 UTC (rev 2471) @@ -157,23 +157,23 @@ #pragma mark * sEither template <class Param> -ZCog<Param> sEither_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Either_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1); template <class Param> -ZCog<Param> sEither(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) +ZCog<Param> sCog_Either(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) { if (iCog0) { if (iCog1) - return sBindR(sCallable(sEither_Fun<Param>), iCog0, iCog1); + return sBindR(sCallable(sCog_Either_Fun<Param>), iCog0, iCog1); return iCog0; } return iCog1; } template <class Param> -ZCog<Param> sEither_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Either_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1) { if (iCog0 && not sCompareAndSet(iCog0, iCog0->Call(iCog0, iParam))) @@ -186,39 +186,39 @@ iCog1 = iCog1->Call(iCog1, iParam); } - return sEither(iCog0, iCog1); + return sCog_Either(iCog0, iCog1); } template <class Param> ZCog<Param> operator+ (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return sEither<Param>(iCallable0, iCallable1); } + { return sCog_Either<Param>(iCallable0, iCallable1); } template <class Param> ZCog<Param>& operator+= (ZCog<Param>& ioCog0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return ioCog0 = sEither<Param>(ioCog0, iCallable1); } + { return ioCog0 = sCog_Either<Param>(ioCog0, iCallable1); } // ================================================================================================= #pragma mark - -#pragma mark * sBoth +#pragma mark * sCog_Both template <class Param> -ZCog<Param> sBoth_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Both_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1); template <class Param> -ZCog<Param> sBoth(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) +ZCog<Param> sCog_Both(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) { if (iCog0 && iCog1) - return sBindR(sCallable(sBoth_Fun<Param>), iCog0, iCog1); + return sBindR(sCallable(sCog_Both_Fun<Param>), iCog0, iCog1); return null; } template <class Param> -ZCog<Param> sBoth_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Both_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1) { if (iCog0 && not sCompareAndSet(iCog0, iCog0->Call(iCog0, iParam))) @@ -231,43 +231,43 @@ iCog1 = iCog1->Call(iCog1, iParam); } - return sBoth(iCog0, iCog1); + return sCog_Both(iCog0, iCog1); } template <class Param> ZCog<Param> operator* (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return sBoth<Param>(iCallable0, iCallable1); } + { return sCog_Both<Param>(iCallable0, iCallable1); } template <class Param> ZCog<Param>& operator*= (ZCog<Param>& ioCog0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return ioCog0 = sBoth<Param>(ioCog0, iCallable1); } + { return ioCog0 = sCog_Both<Param>(ioCog0, iCallable1); } // ================================================================================================= #pragma mark - -#pragma mark * sEach +#pragma mark * sCog_Each template <class Param> -ZCog<Param> sEach_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Each_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1); template <class Param> -ZCog<Param> sEach(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) +ZCog<Param> sCog_Each(const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) { if (iCog0) { if (iCog1) - return sBindR(sCallable(sEach_Fun<Param>), iCog0, iCog1); + return sBindR(sCallable(sCog_Each_Fun<Param>), iCog0, iCog1); return iCog0; } return iCog1; } template <class Param> -ZCog<Param> sEach_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Each_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog0, ZCog<Param> iCog1) { if (iCog0 && not sCompareAndSet(iCog0, iCog0->Call(iCog0, iParam))) @@ -276,27 +276,27 @@ if (!iCog0 && iCog1) iCog1 = iCog1->Call(iCog1, iParam); - return sEach(iCog0, iCog1); + return sCog_Each(iCog0, iCog1); } template <class Param> ZCog<Param> operator| (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return sEach<Param>(iCallable0, iCallable1); } + { return sCog_Each<Param>(iCallable0, iCallable1); } template <class Param> ZCog<Param>& operator|= (ZCog<Param>& ioCog0, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) - { return ioCog0 = sEach<Param>(ioCog0, iCallable1); } + { return ioCog0 = sCog_Each<Param>(ioCog0, iCallable1); } // ================================================================================================= #pragma mark - -#pragma mark * sOnce +#pragma mark * sCog_Once template <class Param> -ZCog<Param> sOnce_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Once_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog) { sCallCog(iCog, iParam); @@ -304,36 +304,36 @@ } template <class Param> -ZCog<Param> sOnce(const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) - { return sBindR(sCallable(sOnce_Fun<Param>), iCallable); } +ZCog<Param> sCog_Once(const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) + { return sBindR(sCallable(sCog_Once_Fun<Param>), iCallable); } // ================================================================================================= #pragma mark - -#pragma mark * sRepeat +#pragma mark * sCog_Repeat template <class Param> -ZCog<Param> sRepeat_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Repeat_Fun(const ZCog<Param>& iSelf, Param iParam, ZCog<Param> iCog_Init, ZCog<Param> iCog) { if (not iCog || not sCompareAndSet(iCog, iCog->Call(iCog, iParam))) return iSelf; if (iCog) - return sBindR(sCallable(sRepeat_Fun<Param>), iCog_Init, iCog); + return sBindR(sCallable(sCog_Repeat_Fun<Param>), iCog_Init, iCog); - return sBindR(sCallable(sRepeat_Fun<Param>), iCog_Init, iCog_Init); + return sBindR(sCallable(sCog_Repeat_Fun<Param>), iCog_Init, iCog_Init); } template <class Param> -ZCog<Param> sRepeat(const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) - { return sBindR(sCallable(sRepeat_Fun<Param>), iCallable, iCallable); } +ZCog<Param> sCog_Repeat(const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) + { return sBindR(sCallable(sCog_Repeat_Fun<Param>), iCallable, iCallable); } // ================================================================================================= #pragma mark - -#pragma mark * sRepeat (count) +#pragma mark * sCog_Repeat (count) template <class Param> -ZCog<Param> sRepeat_Count_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_Repeat_Count_Fun(const ZCog<Param>& iSelf, Param iParam, size_t iCount, ZCog<Param> iCog_Init, ZCog<Param> iCog) { if (not iCount) @@ -343,25 +343,25 @@ return iSelf; if (iCog) - return sBindR(sCallable(sRepeat_Count_Fun<Param>), iCount, iCog_Init, iCog); + return sBindR(sCallable(sCog_Repeat_Count_Fun<Param>), iCount, iCog_Init, iCog); if (--iCount) - return sBindR(sCallable(sRepeat_Count_Fun<Param>), iCount, iCog_Init, iCog_Init); + return sBindR(sCallable(sCog_Repeat_Count_Fun<Param>), iCount, iCog_Init, iCog_Init); return null; } template <class Param> -ZCog<Param> sRepeat(size_t iCount, +ZCog<Param> sCog_Repeat(size_t iCount, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) - { return sBindR(sCallable(sRepeat_Count_Fun<Param>), iCount, iCallable, iCallable); } + { return sBindR(sCallable(sCog_Repeat_Count_Fun<Param>), iCount, iCallable, iCallable); } // ================================================================================================= #pragma mark - -#pragma mark * sDelayUntil +#pragma mark * sCog_DelayUntil template <class Param> -ZCog<Param> sDelayUntil_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_DelayUntil_Fun(const ZCog<Param>& iSelf, Param iParam, ZTime iSystemTime) { if (ZTime::sSystem() > iSystemTime) @@ -370,45 +370,45 @@ } template <class Param> -ZCog<Param> sDelayUntil(ZTime iSystemTime) - { return sBindR(sCallable(sDelayUntil_Fun<Param>), iSystemTime); } +ZCog<Param> sCog_DelayUntil(ZTime iSystemTime) + { return sBindR(sCallable(sCog_DelayUntil_Fun<Param>), iSystemTime); } // ================================================================================================= #pragma mark - -#pragma mark * sDelayFor +#pragma mark * sCog_DelayFor template <class Param> -ZCog<Param> sDelayFor_Fun(const ZCog<Param>& iSelf, Param iParam, +ZCog<Param> sCog_DelayFor_Fun(const ZCog<Param>& iSelf, Param iParam, double iDelay) - { return sCallCog(sDelayUntil<Param>(ZTime::sSystem() + iDelay), iParam); } + { return sCallCog(sCog_DelayUntil<Param>(ZTime::sSystem() + iDelay), iParam); } template <class Param> -ZCog<Param> sDelayFor(double iDelay) - { return sBindR(sCallable(sDelayFor_Fun<Param>), iDelay); } +ZCog<Param> sCog_DelayFor(double iDelay) + { return sBindR(sCallable(sCog_DelayFor_Fun<Param>), iDelay); } // ================================================================================================= #pragma mark - -#pragma mark * sStartAt, sStopAt, sStartAfter, sStopAfter +#pragma mark * sCog_StartAt, sCog_StopAt, sCog_StartAfter, sCog_StopAfter template <class Param> -ZCog<Param> sStartAt(ZTime iSystemTime, +ZCog<Param> sCog_StartAt(ZTime iSystemTime, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCog) - { return sDelayUntil<Param>(iSystemTime) | iCog; } + { return sCog_DelayUntil<Param>(iSystemTime) | iCog; } template <class Param> -ZCog<Param> sStopAt(ZTime iSystemTime, +ZCog<Param> sCog_StopAt(ZTime iSystemTime, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCog) - { return sDelayUntil<Param>(iSystemTime) * iCog; } + { return sCog_DelayUntil<Param>(iSystemTime) * iCog; } template <class Param> -ZCog<Param> sStartAfter(double iDelay, +ZCog<Param> sCog_StartAfter(double iDelay, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCog) - { return sDelayFor<Param>(iDelay) | iCog; } + { return sCog_DelayFor<Param>(iDelay) | iCog; } template <class Param> -ZCog<Param> sStopAfter(double iDelay, +ZCog<Param> sCog_StopAfter(double iDelay, const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCog) - { return sDelayFor<Param>(iDelay) * iCog; } + { return sCog_DelayFor<Param>(iDelay) * iCog; } } // namespace ZooLib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |