RTI Connext .NET API (legacy)  Version 6.1.1
RTI.Connext.Infrastructure.LoanedSamples< T > Class Template Reference

Provides access to a collection of middleware-loaned samples. More...

Inherits AlreadyDisposedHelper< LoanedSamples< T >>, ICollection< Sample< T >>, and IDisposable.

Public Member Functions

IEnumerator< Sample< T > > GetEnumerator ()
 
void Add (Sample< T > item)
 
void Dispose ()
 Returns the loaned samples to the middleware. More...
 
void Clear ()
 
bool Contains (Sample< T > item)
 
void CopyTo (Sample< T >[] array, int arrayIndex)
 
bool Remove (Sample< T > item)
 

Properties

bool IsReadOnly [get]
 
int Count [get]
 Returns the number of samples. More...
 
Sample< T > this[int i] [get]
 

Detailed Description

Provides access to a collection of middleware-loaned samples.

The samples in this container are loaned from the middleware and must be returned at some point.

Warning
This type will be deprecated in a future release and replaced with DDS.Ext.LoanedSamples (which will become DDS.LoanedSamples)

To return the loan, use RTI::Connext::Infrastructure::LoanedSamples<T>::Dispose , from System.IDisposable or enclose this object within a using block.

The contents of this container should not be modified and references to the samples it contains are only valid before the loan is returned.

This class implements ICollection<Sample<T>>. It can be traversed using a foreach block.

As a read-only collection, any operations that modify it are not supported and throw System.InvalidOperationException.

Template Parameters
TThe data type of the contained Samples
See also
RTI::Connext::RequestReply::Requester<TReq,TRep>::TakeReplies(int)
RTI::Connext::RequestReply::Replier<TReq,TRep>::TakeRequests(int)
Taking loaned samples
Taking samples by copy
Type Constraints
T :class 
T :global 
T :DDS.ICopyable<T> 
T :new() 

Member Function Documentation

◆ GetEnumerator()

IEnumerator<Sample<T> > RTI.Connext.Infrastructure.LoanedSamples< T >.GetEnumerator ( )
inline

From ICollection<Sample<T>>

Referenced by RTI.Connext.Infrastructure.LoanedSamples< T >.Remove().

◆ Add()

void RTI.Connext.Infrastructure.LoanedSamples< T >.Add ( Sample< T >  item)
inline
Exceptions
System.InvalidOperationExceptionalways

◆ Dispose()

void RTI.Connext.Infrastructure.LoanedSamples< T >.Dispose ( )
inline

Returns the loaned samples to the middleware.

After calling this operation this object cannot be accessed again.

See also
DDS::TypedDataReader::return_loan (for more information on how the middleware loans samples)

Referenced by RTI.Connext.Infrastructure.LoanedSamples< T >.Add(), and RTI.Connext.Infrastructure.LoanedSamples< T >.Remove().

◆ Clear()

void RTI.Connext.Infrastructure.LoanedSamples< T >.Clear ( )
inline
Exceptions
System.InvalidOperationExceptionalways

◆ Contains()

bool RTI.Connext.Infrastructure.LoanedSamples< T >.Contains ( Sample< T >  item)
inline

From ICollection<Sample<T>>

◆ CopyTo()

void RTI.Connext.Infrastructure.LoanedSamples< T >.CopyTo ( Sample< T > []  array,
int  arrayIndex 
)
inline

From ICollection<Sample<T>>

◆ Remove()

bool RTI.Connext.Infrastructure.LoanedSamples< T >.Remove ( Sample< T >  item)
inline
Exceptions
System.InvalidOperationExceptionalways

Property Documentation

◆ IsReadOnly

bool RTI.Connext.Infrastructure.LoanedSamples< T >.IsReadOnly
get
Returns
true always

◆ Count

Returns the number of samples.

◆ this[int i]

From ICollection<Sample<T>>