Class AnyPtr


  • public class AnyPtr
    extends java.lang.Object
    Smart pointer that can point to any type, and optionally takes ownership of the object pointer.
    • Constructor Detail

      • AnyPtr

        public AnyPtr​(long cPtr,
                      boolean cMemoryOwn)
      • AnyPtr

        public AnyPtr()
        Construct empty null pointer.
      • AnyPtr

        public AnyPtr​(AnyPtr other)
        Copy constructor - ownership is shared.
        Parameters:
        other - [in] other AnyPtr object.
    • Method Detail

      • getCPtr

        public static long getCPtr​(AnyPtr obj)
      • delete

        public void delete()
      • equals

        public boolean equals​(AnyPtr p)
        Equality operator. This only tests if the pointers to the referenced objects are
        the same and NOT if the smart pointers are the same.
        Parameters:
        p - [in] any pointer to compare with
        Returns:
        true if the referenced objects are the same
      • assign

        public AnyPtr assign​(AnyPtr rhs)
        copy assignemt
        Parameters:
        rhs - [in] the Ptr to copy.
      • isNull

        public boolean isNull()
        Check if pointer is null.
        Returns:
        true is the smart pointer is null.