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

# /Users/fpy/titan-1-5-MBARI/Mers/Generators/BFIG/BFIGAssignmentChain.cpp

    00001 //==============================================================================
    00002 // Copyright (c) 2001           Model-based Embedded and Robotic Systems Group
    00003 // All Rights Reserved          Massachusetts Institute of Technology
    00004 //
    00005 // This software is provided as is. Model-based Embedded and Robotic Systems
    00006 // (MERS) group does not assume any responsibility.
    00007 //==============================================================================
    00008 //# CHECKED MJP 08-07-2002
    00009
    00010 #include <cassert>
    00011
    00012 #include "AssignmentChain.h"
    00013
    00014 using namespace std;
    00015
    00016         //----------------------------------------------------
    00017         //      CONSTRUCTOR
    00018         //----------------------------------------------------
    00019
    00020 AssignmentChain::AssignmentChain()
    00021 {
    00022 }
    00023
    00024
    00025 AssignmentChain::AssignmentChain(Assignment const * node, AssignmentChain const * rest)
    00026 {
    00027         curAssignment = node;
    00028         restAssignments = rest;
    00029 }
    00030
    00031
    00032         //----------------------------------------------------
    00033         //      PUBLIC METHODS
    00034         //----------------------------------------------------
    00035
    00036 Assignment const *
    00037 AssignmentChain::getAssignment() const
    00038 {
    00039         return curAssignment;
    00040 }
    00041
    00042
    00043 AssignmentChain const *
    00044 AssignmentChain::getAncestors() const
    00045 {
    00046         return restAssignments;
    00047 }
    00048
    00049
    00050 list<Assignment const *>
    00051 AssignmentChain::combineAssignments() const
    00052 {
    00053         if (restAssignments == NULL)
    00054         {
    00055                 return list<Assignment const *>();
    00056         }
    00057         list<Assignment const *> res = restAssignments->combineAssignments();
    00058         res.push_back(curAssignment);
    00059         return res;
    00060 }
    00061