Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address some of the XML comment warnings
  • Loading branch information
sawilde committed Sep 1, 2015
commit bf26a6da2bc49f3cb538f34c9c8758d7b34fe340
20 changes: 20 additions & 0 deletions main/OpenCover.Framework/Communication/MarshalWapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,32 @@

namespace OpenCover.Framework.Communication
{
/// <summary>
///
/// </summary>
public interface IMarshalWrapper
{
/// <summary>
/// Map pinned memory to a structure
/// </summary>
/// <typeparam name="T">The type of the structure</typeparam>
/// <param name="pinnedMemory"></param>
/// <returns></returns>
T PtrToStructure<T>(IntPtr pinnedMemory);

/// <summary>
/// Map a structure to pinned memory
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="structure"></param>
/// <param name="pinnedMemory"></param>
/// <param name="fDeleteOld"></param>
void StructureToPtr<T>(T structure, IntPtr pinnedMemory, bool fDeleteOld);
}

/// <summary>
/// Implementation of <see cref="IMarshalWrapper"/>
/// </summary>
public class MarshalWrapper : IMarshalWrapper
{
public T PtrToStructure<T>(IntPtr pinnedMemory)
Expand Down
26 changes: 26 additions & 0 deletions main/OpenCover.Framework/Manager/IManagedCommunicationBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,39 @@

namespace OpenCover.Framework.Manager
{
/// <summary>
/// Define a command communication interface
/// </summary>
public interface IManagedCommunicationBlock : IDisposable
{
/// <summary>
/// The communication data
/// </summary>
MemoryMappedViewStream StreamAccessorComms { get; }

/// <summary>
/// Signalled by the profiler when the profiler wants some information
/// </summary>
EventWaitHandle ProfilerRequestsInformation { get; }

/// <summary>
/// Signalled by the host when the data requested is available
/// </summary>
EventWaitHandle InformationReadyForProfiler { get; }

/// <summary>
/// signalled by the profiler when te data has been read by the profiler
/// </summary>
EventWaitHandle InformationReadByProfiler { get; }

/// <summary>
/// The data being communicated
/// </summary>
byte[] DataCommunication { get; }

/// <summary>
/// A handle to the pinned data
/// </summary>
GCHandle PinnedDataCommunication { get; }
}
}
22 changes: 22 additions & 0 deletions main/OpenCover.Framework/Manager/IManagedMemoryBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,34 @@

namespace OpenCover.Framework.Manager
{
/// <summary>
/// Define a results communication interface
/// </summary>
public interface IManagedMemoryBlock : IDisposable
{
/// <summary>
/// Signalled by profiler when the profiler has results
/// </summary>
EventWaitHandle ProfilerHasResults { get; }

/// <summary>
/// Signalled by host when results ahve been read
/// </summary>
EventWaitHandle ResultsHaveBeenReceived { get; }

/// <summary>
/// Access the results
/// </summary>
MemoryMappedViewStream StreamAccessorResults { get; }

/// <summary>
/// Get the buffer size
/// </summary>
int BufferSize { get; }

/// <summary>
/// Get the buffer
/// </summary>
byte[] Buffer { get; }
}
}
51 changes: 51 additions & 0 deletions main/OpenCover.Framework/Manager/IMemoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,75 @@

namespace OpenCover.Framework.Manager
{
/// <summary>
/// Defines the buffer between the host and a profiler instance
/// </summary>
public class ManagedBufferBlock
{
/// <summary>
/// Defines the buffer between the host and a profiler instance
/// </summary>
public ManagedBufferBlock()
{
Active = true;
}

/// <summary>
/// A communication block is where all commands are sent from profiler to host
/// </summary>
public IManagedCommunicationBlock CommunicationBlock { get; set; }

/// <summary>
/// A memory block is were the results are sent
/// </summary>
public IManagedMemoryBlock MemoryBlock { get; set; }

/// <summary>
/// The buffer identifier
/// </summary>
public uint BufferId { get; set; }

/// <summary>
/// Is the block still active?
/// </summary>
public bool Active { get; set; }
}

/// <summary>
/// Defines the interface for a memory manager implementation
/// </summary>
public interface IMemoryManager : IDisposable
{
/// <summary>
/// Initialise a memory manager
/// </summary>
/// <param name="nameSpace"></param>
/// <param name="key"></param>
/// <param name="servicePrincipal"></param>
void Initialise(string nameSpace, string key, IEnumerable<string> servicePrincipal);

/// <summary>
/// Allocate a <see cref="ManagedBufferBlock"/> that is used to communicate between host and profiler
/// </summary>
/// <param name="bufferSize"></param>
/// <param name="bufferId"></param>
/// <returns></returns>
ManagedBufferBlock AllocateMemoryBuffer(int bufferSize, out uint bufferId);

/// <summary>
/// Get the list of all allocated blocks
/// </summary>
IList<ManagedBufferBlock> GetBlocks { get; }

/// <summary>
/// Deactivate a <see cref="ManagedBufferBlock"/>
/// </summary>
/// <param name="bufferId"></param>
void DeactivateMemoryBuffer(uint bufferId);

/// <summary>
/// Remove all deactivated blocks
/// </summary>
void RemoveDeactivatedBlocks();
}
}
2 changes: 1 addition & 1 deletion main/OpenCover.Framework/Symbols/ISymbolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OpenCover.Framework.Symbols
{
public interface ISymbolManager
internal interface ISymbolManager
{
string ModulePath { get; }

Expand Down