Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » PROPOSAL: small / usefull Stream iface extension
Re: PROPOSAL: small / usefull Stream iface extension [message #27953 is a reply to message #27952] Thu, 12 August 2010 00:14 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
and some 2 more..


	void      PutReserve(byte *& p, dword size = 1) { if(ptr + size <= wrlim) { p = ptr; ptr += size; } else p = NULL; }
	dword     GetReserve(byte *& p, dword size = 1) { if(ptr + size <= rdlim) { p = ptr; ptr += size; return size; } 
														else { dword s = dword((uintptr_t)(rdlim - ptr)); return ((s>0)?(p=ptr,s):(0)); } }



could maybe be named PutShadow, GetShadow, or something, to indicate that the buffer is refered only, no memcpy..
this is usefull to modify the data underneeth directly.
 
Read Message icon3.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NEW: Tree<T> container
Next Topic: better Stream manual....more info needed
Goto Forum:
  


Current Time: Mon Jun 10 13:35:37 CEST 2024

Total time taken to generate the page: 0.01299 seconds