servlib/bundling/ExpirationTimer.h
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 /*
       
     2  *    Copyright 2005-2006 Intel Corporation
       
     3  * 
       
     4  *    Licensed under the Apache License, Version 2.0 (the "License");
       
     5  *    you may not use this file except in compliance with the License.
       
     6  *    You may obtain a copy of the License at
       
     7  * 
       
     8  *        http://www.apache.org/licenses/LICENSE-2.0
       
     9  * 
       
    10  *    Unless required by applicable law or agreed to in writing, software
       
    11  *    distributed under the License is distributed on an "AS IS" BASIS,
       
    12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13  *    See the License for the specific language governing permissions and
       
    14  *    limitations under the License.
       
    15  */
       
    16 
       
    17 #ifndef _EXPIRATION_TIMER_H_
       
    18 #define _EXPIRATION_TIMER_H_
       
    19 
       
    20 #include <oasys/thread/Timer.h>
       
    21 #include "BundleRef.h"
       
    22 
       
    23 namespace dtn {
       
    24 
       
    25 /**
       
    26  * Bundle expiration timer class.
       
    27  *
       
    28  * The timer is started when the bundle first arrives at the daemon,
       
    29  * and is cancelled when the daemon removes it from the pending list.
       
    30  *
       
    31  */
       
    32 class ExpirationTimer : public oasys::Timer {
       
    33 public:
       
    34     ExpirationTimer(Bundle* bundle);
       
    35 
       
    36     virtual ~ExpirationTimer() {} 
       
    37 
       
    38     /// The reference to the bundle, which is public since 
       
    39     BundleRef bundleref_;
       
    40     
       
    41 protected:
       
    42     void timeout(const struct timeval& now);
       
    43 
       
    44 };
       
    45 
       
    46 } // namespace dtn
       
    47 
       
    48 #endif /* _EXPIRATION_TIMER_H_ */