本文整理汇总了C++中PUNTOEXE_FUNCTION_END函数的典型用法代码示例。如果您正苦于以下问题:C++ PUNTOEXE_FUNCTION_END函数的具体用法?C++ PUNTOEXE_FUNCTION_END怎么用?C++ PUNTOEXE_FUNCTION_END使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PUNTOEXE_FUNCTION_END函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Set the age in years as a double
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
void dataHandlerStringAS::setDouble(const std::uint32_t index, const double value)
{
PUNTOEXE_FUNCTION_START(L"dataHandlerStringAS::setDouble");
if(value < 0)
{
setAge(index, 0, days);
}
if(value < 0.08)
{
setAge(index, (std::uint32_t)(value * 365), days);
return;
}
if(value < 0.5)
{
setAge(index, (std::uint32_t)(value * 52.14), weeks);
return;
}
if(value < 2)
{
setAge(index, (std::uint32_t)(value * 12), months);
return;
}
setAge(index, (std::uint32_t)value, years);
PUNTOEXE_FUNCTION_END();
}
示例2: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
//
// Tells that no more transforms will be inserted in the
// chain.
//
///////////////////////////////////////////////////////////
void transformsChain::endTransformsChain()
{
PUNTOEXE_FUNCTION_START(L"transformsChain::endTransformsChain");
// If this function has already been called, then return
///////////////////////////////////////////////////////////
if(m_bEndTransformsChainCalled || m_transformsList.size() == 0)
{
return;
}
// Remember we was called
///////////////////////////////////////////////////////////
m_bEndTransformsChainCalled = true;
// Copy all the defined output images to the last transform
// in the chain.
///////////////////////////////////////////////////////////
for(long copyOutputImages = 0; ; ++copyOutputImages)
{
ptr<image> outputImage = getOutputImage(copyOutputImages);
if(outputImage == 0)
{
break;
}
m_transformsList.back()->declareOutputImage(copyOutputImages, outputImage);
}
PUNTOEXE_FUNCTION_END();
}
示例3: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
//
// Initialize the charsetConversion object
//
///////////////////////////////////////////////////////////
void charsetConversion::initialize(const std::string& tableName)
{
PUNTOEXE_FUNCTION_START(L"charsetConversion::initialize");
// Find the table ID
///////////////////////////////////////////////////////////
int requestedTable = findTable(tableName);
if(requestedTable == -1)
{
close();
PUNTOEXE_THROW(charsetConversionExceptionNoTable, "The requested ISO table doesn't exist");
}
// The specified table is already active. Simply return
///////////////////////////////////////////////////////////
if(m_charsetTable[requestedTable].m_isoRegistration == m_isoCharset)
{
return;
}
// Close the active table
///////////////////////////////////////////////////////////
close();
// Save the name of the active table
///////////////////////////////////////////////////////////
m_isoCharset = m_charsetTable[requestedTable].m_isoRegistration;
initialize(requestedTable);
PUNTOEXE_FUNCTION_END();
}
示例4: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Split several parts of a string
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
void dataHandlerDateTimeBase::split(const std::wstring& timeString, const std::wstring& separators, std::vector<std::wstring> *pComponents) const
{
PUNTOEXE_FUNCTION_START(L"dataHandlerDateTimeBase::split");
if(timeString.empty())
{
return;
}
for(size_t startPos(0), sepPos(timeString.find_first_of(separators)); /* empty */; sepPos = timeString.find_first_of(separators, startPos))
{
if(sepPos == timeString.npos)
{
pComponents->push_back(timeString.substr(startPos));
break;
}
pComponents->push_back(timeString.substr(startPos, sepPos - startPos));
startPos = ++sepPos;
if(startPos == timeString.size())
{
pComponents->push_back(L"");
break;
}
}
PUNTOEXE_FUNCTION_END();
}
示例5: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Read an Huffman code
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
imbxUint32 huffmanTable::readHuffmanCode(streamReader* pStream)
{
PUNTOEXE_FUNCTION_START(L"huffmanTable::readHuffmanCode");
// Read initial number of bits
imbxUint32 readBuffer(pStream->readBits(m_firstValidLength));
// Validate the current Huffman code. If it's OK, then
// return the ordered value
///////////////////////////////////////////////////////////
if(readBuffer<=m_maxValuePerLength[m_firstValidLength])
{
return m_orderedValues[readBuffer - m_minValuePerLength[m_firstValidLength]];
}
imbxUint32 orderedValue(m_valuesPerLength[m_firstValidLength]);
// Scan all the codes sizes
///////////////////////////////////////////////////////////
for(imbxUint8 scanSize(m_firstValidLength + 1), missingBits(0); scanSize != sizeof(m_valuesPerLength)/sizeof(m_valuesPerLength[0]); ++scanSize)
{
++missingBits;
// If the active length is empty, then continue the loop
///////////////////////////////////////////////////////////
if(m_valuesPerLength[scanSize] == 0)
{
continue;
}
readBuffer <<= missingBits;
if(missingBits == 1)
{
readBuffer |= pStream->readBit();
}
else
{
readBuffer |= pStream->readBits(missingBits);
}
// Validate the current Huffman code. If it's OK, then
// return the ordered value
///////////////////////////////////////////////////////////
if(readBuffer<=m_maxValuePerLength[scanSize])
{
return m_orderedValues[orderedValue + readBuffer - m_minValuePerLength[scanSize]];
}
orderedValue += m_valuesPerLength[scanSize];
// Reset the number of bits to read in one go
///////////////////////////////////////////////////////////
missingBits = 0;
}
PUNTOEXE_THROW(huffmanExceptionRead, "Invalid huffman code found while reading from a stream");
PUNTOEXE_FUNCTION_END();
}
示例6: PUNTOEXE_FUNCTION_START
void transactionsManager::addHandlerToTransaction(ptr<handlers::dataHandler> newHandler)
{
PUNTOEXE_FUNCTION_START(L"transactionsManager::addHandlerToTransaction");
// Retrieve the transactions manager and lock it
///////////////////////////////////////////////////////////
transactionsManager* pManager = getTransactionsManager();
lockObject lockThis(pManager->m_lockObject.get());
// Find the thread's transactions stack
///////////////////////////////////////////////////////////
std::thread::id threadId = std::this_thread::get_id();
tTransactionsMap::iterator findThread = pManager->m_transactions.find(threadId);
if(findThread == pManager->m_transactions.end())
{
return;
}
// Get the last transaction in the stack
///////////////////////////////////////////////////////////
transaction* pLastTransaction = findThread->second.back(); // This throw if the stack is empty. It's OK
pLastTransaction->addHandler(newHandler);
PUNTOEXE_FUNCTION_END();
}
示例7: baseObject
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Buffer's constructor (on demand content)
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
buffer::buffer(ptr<baseObject> externalLock,
std::string defaultType,
ptr<baseStream> originalStream,
imbxUint32 bufferPosition,
imbxUint32 bufferLength,
imbxUint32 wordLength,
streamController::tByteOrdering endianType):
baseObject(externalLock),
m_originalStream(originalStream),
m_originalBufferPosition(bufferPosition),
m_originalBufferLength(bufferLength),
m_originalWordLength(wordLength),
m_originalEndianType(endianType),
m_version(0)
{
PUNTOEXE_FUNCTION_START(L"buffer::buffer (on demand)");
// Set the buffer's type.
// If the buffer's type is unspecified, then the buffer
// type is set to OB
///////////////////////////////////////////////////////////
if(defaultType.length()==2L)
m_bufferType = defaultType;
else
m_bufferType = "OB";
PUNTOEXE_FUNCTION_END();
}
示例8: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Get a string representation of the time
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
std::wstring dataHandlerTime::getUnicodeString(const imbxUint32 index) const
{
PUNTOEXE_FUNCTION_START(L"dataHandlerTime::getUnicodeString");
imbxInt32 year, month, day, hour, minutes, seconds, nanoseconds, offsetHours, offsetMinutes;
getDate(index, &year, &month, &day, &hour, &minutes, &seconds, &nanoseconds, &offsetHours, &offsetMinutes);
std::wostringstream convStream;
convStream << std::setfill(L'0');
convStream << std::setw(2) << hour;
convStream << std::setw(1) << L":";
convStream << std::setw(2) << minutes;
convStream << std::setw(1) << L":";
convStream << std::setw(2) << seconds;
convStream << std::setw(1) << L".";
convStream << std::setw(6) << nanoseconds;
if(offsetHours != 0 && offsetMinutes != 0)
{
convStream << std::setw(1) << (offsetHours < 0 ? L"-" : L"+");
convStream << std::setw(2) << labs(offsetHours);
convStream << std::setw(1) << L":";
convStream << std::setw(2) << labs(offsetMinutes);
}
return convStream.str();
PUNTOEXE_FUNCTION_END();
}
示例9: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Get a reading stream for the buffer
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
ptr<streamReader> buffer::getStreamReader()
{
PUNTOEXE_FUNCTION_START(L"buffer::getStreamReader");
// Lock the object
///////////////////////////////////////////////////////////
lockObject lockAccess(this);
// If the object must be loaded from the original stream,
// then return the original stream
///////////////////////////////////////////////////////////
if(m_originalStream != 0 && (m_memory == 0 || m_memory->empty()) )
{
ptr<streamReader> reader(new streamReader(m_originalStream, m_originalBufferPosition, m_originalBufferLength));
return reader;
}
// Build a stream from the buffer's memory
///////////////////////////////////////////////////////////
ptr<streamReader> reader;
ptr<handlers::dataHandlerRaw> tempHandlerRaw = getDataHandlerRaw(false);
if(tempHandlerRaw != 0)
{
ptr<baseStream> localStream(new bufferStream(tempHandlerRaw));
reader = ptr<streamReader>(new streamReader(localStream));
}
return reader;
PUNTOEXE_FUNCTION_END();
}
示例10: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
//
// Refill the data buffer
//
///////////////////////////////////////////////////////////
imbxUint32 streamReader::fillDataBuffer()
{
PUNTOEXE_FUNCTION_START(L"streamReader::fillDataBuffer");
imbxUint32 currentPosition = position();
imbxUint32 readLength = (imbxUint32)(m_pDataBufferMaxEnd - m_pDataBufferStart);
if(m_virtualLength != 0)
{
if(currentPosition >= m_virtualLength)
{
m_dataBufferStreamPosition = m_virtualLength;
m_pDataBufferCurrent = m_pDataBufferEnd = m_pDataBufferStart;
return 0;
}
if(currentPosition + readLength > m_virtualLength)
{
readLength = m_virtualLength - currentPosition;
}
}
imbxUint32 readBytes = m_pControlledStream->read(currentPosition + m_virtualStart, m_pDataBufferStart, readLength);
m_dataBufferStreamPosition = currentPosition;
m_pDataBufferEnd = m_pDataBufferStart + readBytes;
m_pDataBufferCurrent = m_pDataBufferStart;
return readBytes;
PUNTOEXE_FUNCTION_END();
}
示例11: TryEnterCriticalSection
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Try to lock a critical section
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
bool criticalSection::tryLock()
{
#ifdef PUNTOEXE_WINDOWS // WINDOWS
return TryEnterCriticalSection(&m_criticalSection) != 0;
#else // POSIX
PUNTOEXE_FUNCTION_START(L"criticalSection::tryLock");
int tryLockResult = pthread_mutex_trylock(&m_criticalSection);
if(tryLockResult == 0)
{
return true;
}
if(tryLockResult == EBUSY)
{
return false;
}
PUNTOEXE_THROW(posixMutexException, "A mutex is in an error state");
PUNTOEXE_FUNCTION_END();
#endif
}
示例12: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Set the charset used in the tag
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
void dataHandlerStringUnicode::setCharsetsList(charsetsList::tCharsetsList* pCharsetsList)
{
PUNTOEXE_FUNCTION_START(L"dataHandlerStringUnicode::setCharsetInfo");
// Copy the specified charsets into the tag
///////////////////////////////////////////////////////////
m_charsetsList.clear();
charsetsList::updateCharsets(pCharsetsList, &m_charsetsList);
// If no charset has been defined then we use the default
// one
///////////////////////////////////////////////////////////
if(m_charsetsList.empty())
{
m_charsetsList.push_back(m_dicomCharsets[0].m_dicomName);
}
// Check for the dicom charset's name
///////////////////////////////////////////////////////////
dicomCharsetInformation* pCharset = getCharsetInfo(m_charsetsList.front());
if(pCharset == 0 || pCharset->m_isoRegistration.empty())
{
PUNTOEXE_THROW(dataHandlerStringUnicodeExceptionUnknownCharset, "Unknown charset");
}
// Setup the conversion objects
///////////////////////////////////////////////////////////
m_charsetConversion->initialize(pCharset->m_isoRegistration);
m_localeCharsetConversion->initialize("LOCALE");
PUNTOEXE_FUNCTION_END();
}
示例13: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Parse a date string
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
void dataHandlerDateTimeBase::parseDate(
std::wstring dateString,
imbxInt32* pYear,
imbxInt32* pMonth,
imbxInt32* pDay)
{
PUNTOEXE_FUNCTION_START(L"dataHandlerDateTimeBase::parseDate");
if(dateString.size()<8)
dateString.resize(8, L'0');
std::wstring dateYear=dateString.substr(0, 4);
std::wstring dateMonth=dateString.substr(4, 2);
std::wstring dateDay=dateString.substr(6, 2);
std::wistringstream yearStream(dateYear);
yearStream >> (*pYear);
std::wistringstream monthStream(dateMonth);
monthStream >> (*pMonth);
std::wistringstream dayStream(dateDay);
dayStream >> (*pDay);
PUNTOEXE_FUNCTION_END();
}
示例14: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Get the size in strings
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
imbxUint32 dataHandlerString::getSize() const
{
PUNTOEXE_FUNCTION_START(L"dataHandlerString::getSize");
return (imbxUint32)m_strings.size();
PUNTOEXE_FUNCTION_END();
}
示例15: PUNTOEXE_FUNCTION_START
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//
//
// Get the value as a signed long.
// Overwritten to use getDouble()
//
//
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
std::int32_t dataHandlerStringDS::getSignedLong(const std::uint32_t index) const
{
PUNTOEXE_FUNCTION_START(L"dataHandlerStringDS::getSignedLong");
return (std::int32_t)getDouble(index);
PUNTOEXE_FUNCTION_END();
}