00001 /* 00002 * Copyright 2004-2006 Intel Corporation 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _SCHEDULED_LINK_H_ 00018 #define _SCHEDULED_LINK_H_ 00019 00020 #include "Link.h" 00021 #include <set> 00022 00023 namespace dtn { 00024 00032 class FutureContact; 00033 00034 class ScheduledLink : public Link { 00035 public: 00036 typedef std::set<FutureContact*> FutureContactSet; 00037 00041 ScheduledLink(std::string name, ConvergenceLayer* cl, 00042 const char* nexthop); 00043 00044 virtual ~ScheduledLink(); 00045 00049 FutureContactSet* future_contacts() { return fcts_; } 00050 00051 // Add a future contact 00052 void add_fc(FutureContact* fc) ; 00053 00054 // Remove a future contact 00055 void delete_fc(FutureContact* fc) ; 00056 00057 // Convert a future contact to an active contact 00058 void convert_fc(FutureContact* fc) ; 00059 00060 // Return list of all future contacts 00061 FutureContactSet* future_contacts_list() { return fcts_; } 00062 00063 protected: 00064 FutureContactSet* fcts_; 00065 }; 00066 00071 class FutureContact { 00072 public: 00076 FutureContact() 00077 : start_(0), duration_(0) 00078 { 00079 } 00080 00082 time_t start_; 00083 00085 time_t duration_; 00086 }; 00087 00088 00089 } // namespace dtn 00090 00091 #endif /* _SCHEDULED_LINK_H_ */