Project: engagement_recognition License: BSD Dependencies:
Used by:
None |
engagement_recognition/src/recognition/events/event_factory.cppGo to the documentation of this file.00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2010, Worcester Polytechnic Institute 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Worcester Polytechnic Institute. nor the names 00018 * of its contributors may be used to endorse or promote products 00019 * derived from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 */ 00034 // @author Brett Ponsler (bponsler (at) wpi (dot) edu) 00035 #include "event_factory.h" 00036 00037 Event EventFactory::completed() 00038 { 00039 return CompletedEvent(); 00040 } 00041 00042 Event EventFactory::cycle() 00043 { 00044 return CycleEvent(); 00045 } 00046 00047 Event EventFactory::failed() 00048 { 00049 return FailedEvent(); 00050 } 00051 00052 Event EventFactory::humanInitiated() 00053 { 00054 return HumanInitiatedEvent(); 00055 } 00056 00057 Event EventFactory::robotInitiated() 00058 { 00059 return RobotInitiatedEvent(); 00060 } 00061 00062 Event EventFactory::sharedGaze() 00063 { 00064 return SharedGazeEvent(); 00065 } 00066 00067 Event EventFactory::success() 00068 { 00069 return SuccessEvent(); 00070 } 00071 00072 Event EventFactory::completed(std::vector<std::string> additional) 00073 { 00074 return CompletedEvent(additional); 00075 } 00076 00077 Event EventFactory::cycle(std::vector<std::string> additional) 00078 { 00079 return CycleEvent(additional); 00080 } 00081 00082 Event EventFactory::failed(std::vector<std::string> additional) 00083 { 00084 return FailedEvent(additional); 00085 } 00086 00087 Event EventFactory::humanInitiated(std::vector<std::string> additional) 00088 { 00089 return HumanInitiatedEvent(additional); 00090 } 00091 00092 Event EventFactory::robotInitiated(std::vector<std::string> additional) 00093 { 00094 return RobotInitiatedEvent(additional); 00095 } 00096 00097 Event EventFactory::sharedGaze(std::vector<std::string> additional) 00098 { 00099 return SharedGazeEvent(additional); 00100 } 00101 00102 Event EventFactory::success(std::vector<std::string> additional) 00103 { 00104 return SuccessEvent(additional); 00105 } 00106 00107 bool EventFactory::isCompleted(Event event) 00108 { 00109 return (event.getName() == CompletedEvent().getName()); 00110 } 00111 00112 bool EventFactory::isCycle(Event event) 00113 { 00114 return (event.getName() == CycleEvent().getName()); 00115 } 00116 00117 bool EventFactory::isFailed(Event event) 00118 { 00119 return (event.getName() == FailedEvent().getName()); 00120 } 00121 00122 bool EventFactory::isHumanInitiated(Event event) 00123 { 00124 return (event.getName() == HumanInitiatedEvent().getName()); 00125 } 00126 00127 bool EventFactory::isRobotInitiated(Event event) 00128 { 00129 return (event.getName() == RobotInitiatedEvent().getName()); 00130 } 00131 00132 bool EventFactory::isSharedGaze(Event event) 00133 { 00134 return (event.getName() == SharedGazeEvent().getName()); 00135 } 00136 00137 bool EventFactory::isSuccess(Event event) 00138 { 00139 return (event.getName() == SuccessEvent().getName()); 00140 } 00141 00142 std::string EventFactory::getCompletedName() 00143 { 00144 return CompletedEvent().getName(); 00145 } 00146 00147 std::string EventFactory::getCycleName() 00148 { 00149 return CycleEvent().getName(); 00150 } 00151 00152 std::string EventFactory::getFailedName() 00153 { 00154 return FailedEvent().getName(); 00155 } 00156 00157 std::string EventFactory::getHumanInitiatedName() 00158 { 00159 return HumanInitiatedEvent().getName(); 00160 } 00161 00162 std::string EventFactory::getRobotInitiatedName() 00163 { 00164 return RobotInitiatedEvent().getName(); 00165 } 00166 00167 std::string EventFactory::getSharedGazeName() 00168 { 00169 return SharedGazeEvent().getName(); 00170 } 00171 00172 std::string EventFactory::getSuccessName() 00173 { 00174 return SuccessEvent().getName(); 00175 } |