Listing 1


class CJobDef
{
    friend CArchive & operator >> (CArchive &ar, CJobDef *def)
    {
        ar >> def->command;
    }
    friend CArchive & operator << (CArchive &ar, CjobDef *def)
    {
        ar << def->command;
    }
private:
    std::string command;
};
class CJobInst
{
    friend CArchive & operator >> (CArchive &ar, CJobInst *inst)
    {
        inst->m_def = new CJobDef;
        ar >> inst->m_def;
    }
    friend CArchive & operator << (CArchive &ar, const CJobInst *inst)
    {
        ar << inst->m_def;
    }
private:
    CJobDef *m_def;
};