Esempio n. 1
0
 /// <summary>
 /// Creates a new PyCacheHint based on the given data
 /// </summary>
 /// <param name="name">The name of the cache hint</param>
 /// <param name="data">The data for the cache hint</param>
 /// <param name="timestamp">The timestamp of the creation of the cache hint</param>
 /// <param name="nodeID">The node that created the cache</param>
 /// <returns></returns>
 public static CachedHint FromBuffer(string name, byte[] data, long timestamp, long nodeID)
 {
     return(new CachedHint
     {
         Version = (int)CRC32.Checksum(data),
         NodeID = nodeID,
         ObjectID = new PyString(name),
         CacheTime = timestamp
     });
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new PyCacheHint based on the given data
 /// </summary>
 /// <param name="objectID">The objectID for this cache hint</param>
 /// <param name="data">The data for the cache hint</param>
 /// <param name="timestamp">The timestamp of the creation of the cache hint</param>
 /// <param name="nodeID">The node that created the cache</param>
 /// <returns></returns>
 public static CachedHint FromBuffer(PyDataType objectID, byte[] data, long timestamp, long nodeID)
 {
     return(new CachedHint
     {
         Version = (int)CRC32.Checksum(data),
         NodeID = nodeID,
         ObjectID = objectID,
         CacheTime = timestamp
     });
 }
Esempio n. 3
0
        /// <summary>
        /// Creates a new PyCacheHint based on the given data
        /// </summary>
        /// <param name="name">The name of the cache hint</param>
        /// <param name="data">The data for the cache hint</param>
        /// <param name="timestamp">The timestamp of the creation of the cache hint</param>
        /// <param name="nodeID">The node that created the cache</param>
        /// <returns></returns>
        public static PyCacheHint FromBuffer(string name, byte[] data, long timestamp, long nodeID)
        {
            PyCacheHint cacheHint = new PyCacheHint();

            cacheHint.Version   = (int)CRC32.Checksum(data);
            cacheHint.NodeID    = nodeID;
            cacheHint.ObjectID  = new PyString(name);
            cacheHint.CacheTime = timestamp;

            return(cacheHint);
        }