Ejemplo n.º 1
0
bool Executable::initialize(void)
{
    __CHECK_NULLPTR(broker);
    __CHECK_NULLPTR(event);

    semInitialize.wait();
    bool ret = broker->init(strCommand.c_str(),
                        strParam.c_str(),
                        strHost.c_str(),
                        strStdio.c_str(),
                        strWorkdir.c_str(),
                        strEnv.c_str());
    semInitialize.post();
    if(!ret)
    {
        OSTRINGSTREAM msg;
        msg<<"cannot initialize broker. : ";
        if(broker->error())
            msg<<broker->error();
        logger->addError(msg);
        event->onExecutableDied(this);
        return false;
    }
    return true;
}
Ejemplo n.º 2
0
bool Node::removeSuc(Node* node)
{
    __CHECK_NULLPTR(node);

    LinkIterator it = findSuc(node);
    if(it != sucessors.end())
        sucessors.erase(it);
    return true;
}
Ejemplo n.º 3
0
bool Node::addSuc(Node* node, float weight, bool _virtual)
{
    __CHECK_NULLPTR(node);

    if(!hasSuc(node))
    {
        Link ln(node, weight, _virtual);
        sucessors.push_back(ln);
    }
    return true;
}