forked from greenenergycorp/dnp3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'gec/master'
- Loading branch information
Showing
62 changed files
with
986 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. Green Enery Corp licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
|
||
#ifndef __DELETE_ANY_H_ | ||
#define __DELETE_ANY_H_ | ||
|
||
#include <vector> | ||
|
||
namespace apl | ||
{ | ||
|
||
/** Useful for posting to a timer source */ | ||
template <class T> | ||
void DeleteAny(const T* apType) | ||
{ | ||
delete apType; | ||
} | ||
|
||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. Green Enery Corp licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
|
||
#ifndef __KEY_KEYS_H_ | ||
#define __KEY_KEYS_H_ | ||
|
||
#include <vector> | ||
|
||
namespace apl | ||
{ | ||
|
||
template <class T, class U> | ||
static std::vector<U> GetKeys(const T& arMap) | ||
{ | ||
std::vector<U> ret; | ||
for(typename T::const_iterator i = arMap.begin(); i != arMap.end(); ++i) { | ||
ret.push_back(i->first); | ||
} | ||
return ret; | ||
} | ||
|
||
} | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. Green Enery Corp licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
#ifndef __I_TIMER_H_ | ||
#define __I_TIMER_H_ | ||
|
||
#include <boost/date_time/posix_time/posix_time_types.hpp> | ||
|
||
namespace apl | ||
{ | ||
|
||
/** | ||
* This is a wrapper for ASIO timers that are used to post events | ||
* on a queue. Events can be posted for immediate consumption or | ||
* some time in the future. Events can be consumbed by the posting | ||
* thread or another thread. | ||
* | ||
* @section Class Goals | ||
* | ||
* Decouple APL code form ASIO so ASIO could be replace if need be. | ||
* | ||
* There is a problem with ASIO. When cancel is called, an event is | ||
* posted. We wanted a cancel that does not generate any events. | ||
* | ||
* @see TimerASIO | ||
*/ | ||
class ITimer | ||
{ | ||
public: | ||
virtual ~ITimer() {} | ||
virtual void Cancel() = 0; | ||
virtual boost::posix_time::ptime ExpiresAt() = 0; | ||
}; | ||
|
||
} | ||
|
||
#endif |
Oops, something went wrong.