115 lines
2.1 KiB
C++
115 lines
2.1 KiB
C++
#ifndef _SCHEDULE_HPP_
|
|
#define _SCHEDULE_HPP_
|
|
#include <mdiwin/windows.hpp>
|
|
#include <mdiwin/types.hpp>
|
|
#include <mdiwin/block.hpp>
|
|
|
|
class Schedule
|
|
{
|
|
public:
|
|
Schedule(void);
|
|
Schedule(float srcWeight,float dstWeight,WORD count);
|
|
Schedule(const Schedule &someSchedule);
|
|
virtual ~Schedule();
|
|
static void createSchedule(Block<Schedule> &someSchedule,WORD nFrames);
|
|
WORD operator==(const Schedule &someSchedule)const;
|
|
Schedule &operator=(const Schedule &someSchedule);
|
|
float srcWeight(void)const;
|
|
void srcWeight(float newSrcWeight);
|
|
float dstWeight(void)const;
|
|
void dstWeight(float newDstWeight);
|
|
WORD count(void)const;
|
|
void count(WORD newCount);
|
|
WORD isValid(void)const;
|
|
private:
|
|
enum {DefaultCount=1};
|
|
float mSrcWeight;
|
|
float mDstWeight;
|
|
WORD mCount;
|
|
};
|
|
|
|
inline
|
|
Schedule::Schedule(void)
|
|
: mSrcWeight(0.00), mDstWeight(0.00), mCount(DefaultCount)
|
|
{
|
|
}
|
|
|
|
inline
|
|
Schedule::Schedule(float srcWeight,float dstWeight,WORD count)
|
|
: mSrcWeight(srcWeight), mDstWeight(dstWeight), mCount(count)
|
|
{
|
|
}
|
|
|
|
inline
|
|
Schedule::Schedule(const Schedule &someSchedule)
|
|
: mSrcWeight(someSchedule.mSrcWeight), mDstWeight(someSchedule.mDstWeight),
|
|
mCount(someSchedule.mCount)
|
|
{
|
|
}
|
|
|
|
inline
|
|
Schedule::~Schedule()
|
|
{
|
|
}
|
|
|
|
inline
|
|
WORD Schedule::operator==(const Schedule &someSchedule)const
|
|
{
|
|
return (mCount==someSchedule.mCount&&
|
|
mSrcWeight==someSchedule.mSrcWeight&&
|
|
mDstWeight==someSchedule.mDstWeight);
|
|
}
|
|
|
|
inline
|
|
Schedule &Schedule::operator=(const Schedule &someSchedule)
|
|
{
|
|
mSrcWeight=someSchedule.mSrcWeight;
|
|
mDstWeight=someSchedule.mDstWeight;
|
|
mCount=someSchedule.mCount;
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
float Schedule::srcWeight(void)const
|
|
{
|
|
return mSrcWeight;
|
|
}
|
|
|
|
inline
|
|
void Schedule::srcWeight(float newSrcWeight)
|
|
{
|
|
mSrcWeight=newSrcWeight;
|
|
}
|
|
|
|
inline
|
|
float Schedule::dstWeight(void)const
|
|
{
|
|
return mDstWeight;
|
|
}
|
|
|
|
inline
|
|
void Schedule::dstWeight(float newDstWeight)
|
|
{
|
|
mDstWeight=newDstWeight;
|
|
}
|
|
|
|
inline
|
|
WORD Schedule::count(void)const
|
|
{
|
|
return mCount;
|
|
}
|
|
|
|
inline
|
|
void Schedule::count(WORD newCount)
|
|
{
|
|
mCount=newCount;
|
|
}
|
|
|
|
inline
|
|
WORD Schedule::isValid(void)const
|
|
{
|
|
float result=mSrcWeight+mDstWeight;
|
|
return (result==1.00);
|
|
}
|
|
#endif
|