sk_value() private method

private sk_value ( IntPtr stack, int index ) : IntPtr
stack IntPtr
index int
return IntPtr
Example #1
0
 /// <summary>
 /// Indexer that returns sk_value() or calls sk_insert()
 /// </summary>
 /// <param name="index"></param>
 /// <returns></returns>
 public T this[int index]
 {
     get
     {
         // Get the native pointer from the stack
         IntPtr ptr = Native.ExpectNonNull(Native.sk_value(this.ptr, index));
         // Create a new object
         T item = CreateInstance(ptr);
         // Addref the object
         item.AddRef();
         // Return the managed object
         return(item);
     }
     set
     {
         // Insert the item in the stack
         int ret = Native.sk_insert(this.ptr, value.Handle, index);
         if (ret < 0)
         {
             throw new OpenSslException();
         }
         // Addref the native pointer
         value.AddRef();
     }
 }