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 _SIMPLE_NODE_H_ 00018 #define _SIMPLE_NODE_H_ 00019 00020 #include "Node.h" 00021 00022 namespace dtnsim { 00023 00024 /* 00025 * A simple node definition that performs random routing 00026 */ 00027 00028 class SimpleNode : public Node { 00029 00030 public: 00031 00032 SimpleNode(int id, const char* logpath); 00033 virtual ~SimpleNode(); 00034 00039 virtual void process(Event *e); 00040 virtual void chewing_complete(SimContact* c, double size, Message* msg); 00041 virtual void open_contact(SimContact* c); 00042 virtual void close_contact(SimContact* c); 00043 virtual void message_received(Message* msg); 00044 00045 00046 private: 00047 virtual void forward(Message* msg); 00048 std::vector<Message*> msgq_; 00049 00050 }; 00051 00052 } // namespace dtnsim 00053 00054 #endif /* _SIMPLE_NODE_H_ */