$search
00001 /* 00002 * Copyright (C) 2008, Morgan Quigley and Willow Garage, Inc. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions are met: 00006 * * Redistributions of source code must retain the above copyright notice, 00007 * this list of conditions and the following disclaimer. 00008 * * Redistributions in binary form must reproduce the above copyright 00009 * notice, this list of conditions and the following disclaimer in the 00010 * documentation and/or other materials provided with the distribution. 00011 * * Neither the names of Stanford University or Willow Garage, Inc. nor the names of its 00012 * contributors may be used to endorse or promote products derived from 00013 * this software without specific prior written permission. 00014 * 00015 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00016 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00017 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00018 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00019 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00020 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00021 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00022 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00023 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00024 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00025 * POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 #ifndef ROSCPP_FORWARDS_H 00029 #define ROSCPP_FORWARDS_H 00030 00031 #include <string> 00032 #include <vector> 00033 #include <map> 00034 #include <set> 00035 #include <list> 00036 00037 #include <boost/shared_ptr.hpp> 00038 #include <boost/weak_ptr.hpp> 00039 #include <boost/function.hpp> 00040 00041 #include <ros/time.h> 00042 #include <ros/macros.h> 00043 #include "exceptions.h" 00044 00045 namespace ros 00046 { 00047 00048 typedef boost::shared_ptr<void> VoidPtr; 00049 typedef boost::weak_ptr<void> VoidWPtr; 00050 typedef boost::shared_ptr<void const> VoidConstPtr; 00051 typedef boost::weak_ptr<void const> VoidConstWPtr; 00052 00053 class Header; 00054 class Transport; 00055 typedef boost::shared_ptr<Transport> TransportPtr; 00056 class TransportTCP; 00057 typedef boost::shared_ptr<TransportTCP> TransportTCPPtr; 00058 class TransportUDP; 00059 typedef boost::shared_ptr<TransportUDP> TransportUDPPtr; 00060 class Connection; 00061 typedef boost::shared_ptr<Connection> ConnectionPtr; 00062 typedef std::set<ConnectionPtr> S_Connection; 00063 typedef std::vector<ConnectionPtr> V_Connection; 00064 class Publication; 00065 typedef boost::shared_ptr<Publication> PublicationPtr; 00066 typedef std::vector<PublicationPtr> V_Publication; 00067 class SubscriberLink; 00068 typedef boost::shared_ptr<SubscriberLink> SubscriberLinkPtr; 00069 typedef std::vector<SubscriberLinkPtr> V_SubscriberLink; 00070 class Subscription; 00071 typedef boost::shared_ptr<Subscription> SubscriptionPtr; 00072 typedef boost::weak_ptr<Subscription> SubscriptionWPtr; 00073 typedef std::list<SubscriptionPtr> L_Subscription; 00074 typedef std::vector<SubscriptionPtr> V_Subscription; 00075 typedef std::set<SubscriptionPtr> S_Subscription; 00076 class PublisherLink; 00077 typedef boost::shared_ptr<PublisherLink> PublisherLinkPtr; 00078 typedef std::vector<PublisherLinkPtr> V_PublisherLink; 00079 class ServicePublication; 00080 typedef boost::shared_ptr<ServicePublication> ServicePublicationPtr; 00081 typedef std::list<ServicePublicationPtr> L_ServicePublication; 00082 typedef std::vector<ServicePublicationPtr> V_ServicePublication; 00083 class ServiceServerLink; 00084 typedef boost::shared_ptr<ServiceServerLink> ServiceServerLinkPtr; 00085 typedef std::list<ServiceServerLinkPtr> L_ServiceServerLink; 00086 class Transport; 00087 typedef boost::shared_ptr<Transport> TransportPtr; 00088 class NodeHandle; 00089 typedef boost::shared_ptr<NodeHandle> NodeHandlePtr; 00090 00091 typedef std::vector<std::pair<std::string, std::string> > VP_string; 00092 typedef std::vector<std::string> V_string; 00093 typedef std::set<std::string> S_string; 00094 typedef std::map<std::string, std::string> M_string; 00095 typedef std::pair<std::string, std::string> StringPair; 00096 00097 class SingleSubscriberPublisher; 00098 typedef boost::function<void(const SingleSubscriberPublisher&)> SubscriberStatusCallback; 00099 00100 class CallbackQueue; 00101 class CallbackQueueInterface; 00102 class CallbackInterface; 00103 typedef boost::shared_ptr<CallbackInterface> CallbackInterfacePtr; 00104 00105 struct SubscriberCallbacks 00106 { 00107 SubscriberCallbacks(const SubscriberStatusCallback& connect = SubscriberStatusCallback(), 00108 const SubscriberStatusCallback& disconnect = SubscriberStatusCallback(), 00109 const VoidConstPtr& tracked_object = VoidConstPtr(), 00110 CallbackQueueInterface* callback_queue = 0) 00111 : connect_(connect) 00112 , disconnect_(disconnect) 00113 , callback_queue_(callback_queue) 00114 { 00115 has_tracked_object_ = false; 00116 if (tracked_object) 00117 { 00118 has_tracked_object_ = true; 00119 tracked_object_ = tracked_object; 00120 } 00121 } 00122 SubscriberStatusCallback connect_; 00123 SubscriberStatusCallback disconnect_; 00124 00125 bool has_tracked_object_; 00126 VoidConstWPtr tracked_object_; 00127 CallbackQueueInterface* callback_queue_; 00128 }; 00129 typedef boost::shared_ptr<SubscriberCallbacks> SubscriberCallbacksPtr; 00130 00134 struct TimerEvent 00135 { 00136 Time last_expected; 00137 Time last_real; 00138 00139 Time current_expected; 00140 Time current_real; 00141 00142 struct 00143 { 00144 WallDuration last_duration; 00145 } profile; 00146 }; 00147 typedef boost::function<void(const TimerEvent&)> TimerCallback; 00148 00152 struct WallTimerEvent 00153 { 00154 WallTime last_expected; 00155 WallTime last_real; 00156 00157 WallTime current_expected; 00158 WallTime current_real; 00159 00160 struct 00161 { 00162 WallDuration last_duration; 00163 } profile; 00164 }; 00165 typedef boost::function<void(const WallTimerEvent&)> WallTimerCallback; 00166 00167 class ServiceManager; 00168 typedef boost::shared_ptr<ServiceManager> ServiceManagerPtr; 00169 class TopicManager; 00170 typedef boost::shared_ptr<TopicManager> TopicManagerPtr; 00171 class ConnectionManager; 00172 typedef boost::shared_ptr<ConnectionManager> ConnectionManagerPtr; 00173 class XMLRPCManager; 00174 typedef boost::shared_ptr<XMLRPCManager> XMLRPCManagerPtr; 00175 class PollManager; 00176 typedef boost::shared_ptr<PollManager> PollManagerPtr; 00177 00178 } 00179 00180 #endif