-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #486 from lukemartinlogan/master
Hermes 0.9.5
- Loading branch information
Showing
111 changed files
with
12,844 additions
and
4 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
27 changes: 27 additions & 0 deletions
27
hermes_shm/include/hermes_shm/constants/data_structure_singleton_macros.h
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,27 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Distributed under BSD 3-Clause license. * | ||
* Copyright by The HDF Group. * | ||
* Copyright by the Illinois Institute of Technology. * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of Hermes. The full Hermes copyright notice, including * | ||
* terms governing use, modification, and redistribution, is contained in * | ||
* the COPYING file, which can be found at the top directory. If you do not * | ||
* have access to the file, you may request a copy from [email protected]. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef HERMES_SHM_INCLUDE_HERMES_SHM_CONSTANTS_DATA_STRUCTURE_SINGLETON_MACROS_H_H | ||
#define HERMES_SHM_INCLUDE_HERMES_SHM_CONSTANTS_DATA_STRUCTURE_SINGLETON_MACROS_H_H | ||
|
||
#include <hermes_shm/util/singleton.h> | ||
|
||
#define HERMES_SHM_SYSTEM_INFO scs::Singleton<hermes_shm::SystemInfo>::GetInstance() | ||
#define HERMES_SHM_SYSTEM_INFO_T hermes_shm::SystemInfo* | ||
|
||
#define HERMES_SHM_MEMORY_MANAGER scs::Singleton<hermes_shm::ipc::MemoryManager>::GetInstance() | ||
#define HERMES_SHM_MEMORY_MANAGER_T hermes_shm::ipc::MemoryManager* | ||
|
||
#define HERMES_SHM_THREAD_MANAGER scs::Singleton<hermes_shm::ThreadManager>::GetInstance() | ||
#define HERMES_SHM_THREAD_MANAGER_T hermes_shm::ThreadManager* | ||
|
||
#endif // include_labstor_constants_data_structure_singleton_macros_h |
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,30 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Distributed under BSD 3-Clause license. * | ||
* Copyright by The HDF Group. * | ||
* Copyright by the Illinois Institute of Technology. * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of Hermes. The full Hermes copyright notice, including * | ||
* terms governing use, modification, and redistribution, is contained in * | ||
* the COPYING file, which can be found at the top directory. If you do not * | ||
* have access to the file, you may request a copy from [email protected]. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef HERMES_SHM_MACROS_H | ||
#define HERMES_SHM_MACROS_H | ||
|
||
#define KILOBYTES(n) ((size_t)(n) * (1<<10)) | ||
#define MEGABYTES(n) ((size_t)(n) * (1<<20)) | ||
#define GIGABYTES(n) ((size_t)(n) * (1<<30)) | ||
|
||
#define TYPE_BITS(type) ((sizeof(type)*8)) | ||
|
||
#define TYPE_WRAP(...) (__VA_ARGS__) | ||
|
||
#define TYPE_UNWRAP(X) ESC(ISH X) | ||
#define ISH(...) ISH __VA_ARGS__ | ||
#define ESC(...) ESC_(__VA_ARGS__) | ||
#define ESC_(...) VAN ## __VA_ARGS__ | ||
#define VANISH | ||
|
||
#endif // HERMES_SHM_MACROS_H |
22 changes: 22 additions & 0 deletions
22
hermes_shm/include/hermes_shm/data_structures/data_structure.h
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,22 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Distributed under BSD 3-Clause license. * | ||
* Copyright by The HDF Group. * | ||
* Copyright by the Illinois Institute of Technology. * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of Hermes. The full Hermes copyright notice, including * | ||
* terms governing use, modification, and redistribution, is contained in * | ||
* the COPYING file, which can be found at the top directory. If you do not * | ||
* have access to the file, you may request a copy from [email protected]. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_ | ||
#define HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_ | ||
|
||
#include "internal/shm_archive.h" | ||
#include "internal/shm_container.h" | ||
#include "internal/shm_smart_ptr.h" | ||
#include "internal/shm_macros.h" | ||
#include "internal/shm_container.h" | ||
|
||
#endif // HERMES_SHM_DATA_STRUCTURES_DATA_STRUCTURE_H_ |
105 changes: 105 additions & 0 deletions
105
hermes_shm/include/hermes_shm/data_structures/internal/shm_archive.h
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,105 @@ | ||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Distributed under BSD 3-Clause license. * | ||
* Copyright by The HDF Group. * | ||
* Copyright by the Illinois Institute of Technology. * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of Hermes. The full Hermes copyright notice, including * | ||
* terms governing use, modification, and redistribution, is contained in * | ||
* the COPYING file, which can be found at the top directory. If you do not * | ||
* have access to the file, you may request a copy from [email protected]. * | ||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
|
||
#ifndef HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_ | ||
#define HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_ | ||
|
||
#include "hermes_shm/memory/memory_manager.h" | ||
#include "shm_macros.h" | ||
|
||
namespace hermes_shm::ipc { | ||
|
||
/** | ||
* Indicates that a data structure can be stored directly in memory or | ||
* shared memory. | ||
* */ | ||
class ShmPredictable {}; | ||
|
||
/** | ||
* Indicates that a data structure can be archived in shared memory | ||
* and has a corresponding TypedPointer override. | ||
* */ | ||
class ShmArchiveable : public ShmPredictable { | ||
/** | ||
* Initialize a SHM data structure in shared-memory. | ||
* Constructors may wrap around these. | ||
* */ | ||
// void shm_init(...); | ||
|
||
/** | ||
* Destroys the shared-memory allocated by the object. | ||
* Destructors may wrap around this. | ||
* */ | ||
// void shm_destroy(); | ||
|
||
/** | ||
* Deep copy of an object. Wrapped by copy constructor | ||
* */ | ||
// void shm_strong_copy(const CLASS_NAME &other); | ||
// SHM_INHERIT_COPY_OPS(CLASS_NAME) | ||
|
||
/** | ||
* Copies only the object's pointers. | ||
* */ | ||
// void WeakCopy(const CLASS_NAME &other); | ||
|
||
/** | ||
* Moves the object's contents into another object | ||
* */ | ||
// void shm_weak_move(CLASS_NAME &other); | ||
// SHM_INHERIT_MOVE_OPS(CLASS_NAME) | ||
|
||
/** | ||
* Store object into a TypedPointer | ||
* */ | ||
// void shm_serialize(TypedPointer<TYPED_CLASS> &ar) const; | ||
// SHM_SERIALIZE_OPS(TYPED_CLASS) | ||
|
||
/** | ||
* Construct object from a TypedPointer. | ||
* */ | ||
// void shm_deserialize(const TypedPointer<TYPED_CLASS> &ar); | ||
// SHM_DESERIALIZE_OPS(TYPED_CLASS) | ||
}; | ||
|
||
/** | ||
* Enables a specific TypedPointer type to be serialized | ||
* */ | ||
#define SHM_SERIALIZE_OPS(TYPED_CLASS)\ | ||
void operator>>(hipc::TypedPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) const {\ | ||
shm_serialize(ar);\ | ||
}\ | ||
void operator>>(hipc::TypedAtomicPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) const {\ | ||
shm_serialize(ar);\ | ||
} | ||
|
||
/** | ||
* Enables a specific TypedPointer type to be deserialized | ||
* */ | ||
#define SHM_DESERIALIZE_OPS(TYPED_CLASS)\ | ||
void operator<<(const hipc::TypedPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) {\ | ||
shm_deserialize(ar);\ | ||
}\ | ||
void operator<<(\ | ||
const hipc::TypedAtomicPointer<TYPE_UNWRAP(TYPED_CLASS)> &ar) {\ | ||
shm_deserialize(ar);\ | ||
} | ||
|
||
/** Enables serialization + deserialization for data structures */ | ||
#define SHM_SERIALIZE_DESERIALIZE_OPS(AR_TYPE)\ | ||
SHM_SERIALIZE_OPS(AR_TYPE)\ | ||
SHM_DESERIALIZE_OPS(AR_TYPE) | ||
|
||
|
||
} // namespace hermes_shm::ipc | ||
|
||
#endif // HERMES_SHM_DATA_STRUCTURES_SHM_ARCHIVE_H_ |
Oops, something went wrong.