- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/Task.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #include "Task.h"
    00015
    00016 #include <Mers/Models/Base/BaseModelVariable.h>
    00017 #include <Mers/Models/Base/BaseModelValue.h>
    00018
    00020
    00021 using namespace Mers::Executives::DeductiveController;
    00022 using Mers::Models::Base::BaseModelVariable;
    00023 using Mers::Models::Base::BaseModelValue;
    00024 using Mers::Utils::Lang::String;
    00025
    00027
    00028 Task::Task(BaseModelVariable * var, BaseModelValue * value)
    00029         : Mers::Interfaces::Task(var->getName()), mVar(var), mVal(value)
    00030 {
    00031         mParameters.push_back(new String(mVal->getName()));
    00032 }
    00033
    00035
    00036 Task::~Task()
    00037 {
    00038 }
    00039
    00041
    00042 BaseModelVariable * Task::getVariable()
    00043 {
    00044         return mVar;
    00045 }
    00046
    00048
    00049 BaseModelValue * Task::getValue()
    00050 {
    00051         return mVal;
    00052 }
    00053
    00055
    00056 String Task::toString() const
    00057 {
    00058   // Note that we could create this once and store it since our values
    00059   // don't change.
    00060   String result( mVar->getName() );
    00061
    00062         result += "[";
    00063         result += mVar->getUID();
    00064         result += "]( ";
    00065         result += mVal->getName();
    00066         result += "[";
    00067         result += mVal->getUID();
    00068         result += "] )";
    00069
    00070         return result;
    00071 }
    00072