本文整理汇总了C++中CComplexArray类的典型用法代码示例。如果您正苦于以下问题:C++ CComplexArray类的具体用法?C++ CComplexArray怎么用?C++ CComplexArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CComplexArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMessageReplyError
void CAeonEngine::MsgGetTables (const SArchonMessage &Msg, const CHexeSecurityCtx *pSecurityCtx)
// MsgGetTables
//
// Aeon.getTables
{
int i;
if (!m_bReady)
{
SendMessageReplyError(MSG_ERROR_UNABLE_TO_COMPLY, ERR_NOT_READY, Msg);
return;
}
// Get a list of all tables
TArray<CAeonTable *> AllTables;
GetTables(&AllTables);
// Return an array of table descriptors
CComplexArray *pArray = new CComplexArray;
for (i = 0; i < AllTables.GetCount(); i++)
{
if (pSecurityCtx && !pSecurityCtx->IsNamespaceAccessible(AllTables[i]->GetName()))
continue;
pArray->Insert(AllTables[i]->GetDesc());
}
// Reply
SendMessageReply(MSG_AEON_RESULT_TABLES, CDatum(pArray), Msg);
}
示例2: Lock
CDatum CHyperionScheduler::GetTaskList (void)
// GetTaskList
//
// Returns a list of tasks
{
CSmartLock Lock(m_cs);
int i;
CComplexArray *pResult = new CComplexArray;
for (i = 0; i < m_Tasks.GetCount(); i++)
{
CComplexStruct *pTask = new CComplexStruct;
pTask->SetElement(FIELD_NAME, m_Tasks[i].sName);
pTask->SetElement(FIELD_STATUS, (m_Tasks[i].bRunning ? STATUS_RUNNING : STATUS_READY));
pTask->SetElement(FIELD_LAST_RAN_ON, m_Tasks[i].LastRun);
pTask->SetElement(FIELD_WILL_RUN_ON, m_Tasks[i].NextRun);
pTask->SetElement(FIELD_RUN_FREQUENCY, m_Tasks[i].iInterval);
pResult->Append(CDatum(pTask));
}
return CDatum(pResult);
}
示例3: CreateFromAttributeList
bool CDatum::CreateFromAttributeList (const CAttributeList &Attribs, CDatum *retdDatum)
// CreateFromAttributeList
//
// Creates a datum from an attribute list
{
int i;
TArray<CString> AllAttribs;
Attribs.GetAll(&AllAttribs);
if (AllAttribs.GetCount() == 0)
{
*retdDatum = CDatum();
return true;
}
CComplexArray *pArray = new CComplexArray;
for (i = 0; i < AllAttribs.GetCount(); i++)
pArray->Insert(AllAttribs[i]);
*retdDatum = CDatum(pArray);
return true;
}
示例4: OnStartSession
bool CUserInfoSession::OnStartSession (const SArchonMessage &Msg, DWORD dwTicket)
// OnStartSession
//
// Start
{
// Send an Aeon message to get the user record
CComplexArray *pPayload = new CComplexArray;
pPayload->Insert(USERS_TABLE_NAME);
pPayload->Insert(m_sUsernameKey);
// Send message
ISessionHandler::SendMessageCommand(ADDRESS_AEON_COMMAND,
MSG_AEON_GET_VALUE,
GenerateAddress(PORT_CRYPTOSAUR_COMMAND),
CDatum(pPayload),
MESSAGE_TIMEOUT);
// Expect reply
return true;
}
示例5: SendMessageReplyOnWrite
void CEsperEngine::SendMessageReplyOnWrite (CDatum dConnection, DWORD dwBytesTransferred, const SArchonMessage &OriginalMsg)
// SendMessageReplyOnWrite
//
// Reply with Esper.onWrite
{
CComplexArray *pPayload = new CComplexArray;
pPayload->Insert(dwBytesTransferred);
pPayload->Insert(dConnection);
m_pProcess->SendMessageReply(MSG_ESPER_ON_WRITE, CDatum(pPayload), OriginalMsg);
}
示例6: GenerateCollectionsArray
CDatum CMnemosynthDb::GenerateCollectionsArray (void)
// GenerateCollectionsArray
//
// Creates an array of collection names.
//
// NOTE: Our callers rely on the fact that this includes all colelctions,
// even ones with no entries.
{
int i;
CComplexArray *pCollections = new CComplexArray;
for (i = 0; i < m_Collections.GetCount(); i++)
pCollections->Insert(m_Collections.GetKey(i));
return CDatum(pCollections);
}
示例7: SendMessageReplyOnRead
void CEsperEngine::SendMessageReplyOnRead (CDatum dConnection, CString &sData, const SArchonMessage &OriginalMsg)
// SendMessageReplyOnRead
//
// Reply with Esper.onRead
{
int iDataLen = sData.GetLength();
CDatum dData;
CDatum::CreateStringFromHandoff(sData, &dData);
CComplexArray *pPayload = new CComplexArray;
pPayload->Insert(dData);
pPayload->Insert((int)iDataLen);
pPayload->Insert(dConnection);
m_pProcess->SendMessageReply(MSG_ESPER_ON_READ, CDatum(pPayload), OriginalMsg);
}
示例8: GenerateEntry
CDatum CMnemosynthDb::GenerateEntry (int iCollectionIndex, const CString &sKey, SEntry *pEntry)
// GenerateEntry
//
// Generates an entry of the form:
// 0: collection index
// 1: key
// 2: value
// 3: sequence
{
CComplexArray *pArray = new CComplexArray;
pArray->Insert(iCollectionIndex);
pArray->Insert(sKey);
pArray->Insert(pEntry->dValue);
pArray->Insert((int)pEntry->dwSequence);
return CDatum(pArray);
}
示例9: GetModuleName
bool CArchonProcess::OnModuleStart (void)
// OnModuleStart
//
// Sends a message to central process telling it our status
{
// If we're not the CentralModule then we need to send a message to
// this machine's Exarch telling it that we have started.
if (!m_bCentralModule && !m_bConsoleMode)
{
// Figure out the Mnemosynth sequence number for this endpoint at this
// point in time. We send it over to Exarch so that it waits until it
// synchronizes to that point before assuming that loading is complete.
CString sEndpoint = CMnemosynthDb::GenerateEndpointName(GetMachineName(), GetModuleName());
DWORD dwSeq = m_MnemosynthDb.GetSequence(sEndpoint);
ASSERT(dwSeq != 0xffffffff);
if (dwSeq == 0xffffffff)
{
Log(MSG_LOG_ERROR, ERR_UNABLE_TO_OPEN_MNEMOSYNTH);
return false;
}
// Compose the message
CComplexArray *pArray = new CComplexArray;
pArray->Insert(m_sName);
pArray->Insert((int)dwSeq);
if (!SendMessageCommand(ADDR_EXARCH_COMMAND, MSG_EXARCH_ON_MODULE_START, NULL_STR, 0, CDatum(pArray)))
{
Log(MSG_LOG_ERROR, ERR_UNABLE_TO_SEND_TO_EXARCH);
return false;
}
}
// Done
return true;
}
示例10: DebugDump
CDatum CAeonView::DebugDump (void) const
// DebugDump
//
// Returns data about the view.
{
int i;
CComplexStruct *pData = new CComplexStruct;
pData->SetElement(FIELD_RECOVERY_FILESPEC, m_Recovery.GetFilespec());
CComplexArray *pSegments = new CComplexArray;
for (i = 0; i < m_Segments.GetCount(); i++)
pSegments->Append(m_Segments[i]->DebugDump());
pData->SetElement(FIELD_SEGMENTS, CDatum(pSegments));
return CDatum(pData);
}
示例11: Log
void CArchonProcess::ReportVolumeFailure (const CString &sFilespec, const CString &sOperation)
// ReportVolumeFailure
//
// And engine calls this method when it fails reading/writing to the given
// filespec.
{
// We log from here so that we transmit the module that ran into the problem.
Log(MSG_LOG_ERROR, strPattern(ERR_DISK, sFilespec));
// Send a message to Exarch to check the volume.
CComplexArray *pArray = new CComplexArray;
pArray->Insert(sFilespec);
if (!sOperation.IsEmpty())
pArray->Insert(sOperation);
SendMessageCommand(ADDR_EXARCH_COMMAND, MSG_EXARCH_REPORT_DISK_ERROR, NULL_STR, 0, CDatum(pArray));
}
示例12: OnStartSession
bool CAddModuleSession::OnStartSession (const SArchonMessage &Msg, DWORD dwTicket)
// OnStartSession
//
// Start the session
{
// Payload
CComplexArray *pPayload = new CComplexArray;
pPayload->Append(m_sModule);
// Connect to the machine with a command.
m_iState = stateWaitForMsg;
SendMessageCommand(m_sAddress, MSG_EXARCH_ADD_MODULE, ADDRESS_EXARCH_COMMAND, CDatum(pPayload));
// Expect reply
return true;
}
示例13: TranspaceDownload
void CArchonProcess::TranspaceDownload (const CString &sAddress, const CString &sReplyAddr, DWORD dwTicket, CDatum dDownloadDesc, const CHexeSecurityCtx *pSecurityCtx)
// TranspaceDownload
//
// Downloads a file by Transpace address.
{
// Compose a proper download command payload
CComplexArray *pPayload = new CComplexArray;
pPayload->Append(sAddress);
pPayload->Append(sAddress);
pPayload->Append(dDownloadDesc);
CDatum dPayload(pPayload);
// Transform the address into a message and a new address
CString sDestMsgAddress;
CString sDestMsg;
CDatum dDestPayload;
CString sError;
if (!TransformAddress(sAddress, MSG_TRANSPACE_DOWNLOAD, dPayload, &sDestMsgAddress, &sDestMsg, &dDestPayload, &sError))
{
SendMessageCommand(sReplyAddr, MSG_ERROR_UNABLE_TO_COMPLY, NULL_STR, dwTicket, CDatum(sError));
return;
}
// Send the message
if (pSecurityCtx)
{
CString sWrappedMsg;
CDatum dWrappedPayload;
CHexeProcess::ComposeHexarcMessage(*pSecurityCtx, sDestMsg, dDestPayload, &sWrappedMsg, &dWrappedPayload);
SendMessageCommand(sDestMsgAddress, sWrappedMsg, sReplyAddr, dwTicket, dWrappedPayload);
}
else
SendMessageCommand(sDestMsgAddress, sDestMsg, sReplyAddr, dwTicket, dDestPayload);
}
示例14: CDatum
bool CUserInfoSession::UpdateLoginFailure (void)
// UpdateLoginFailure
//
// Update the user record with the most recent failure
{
// Set our state
m_iState = stateWaitingForFailureUpdate;
// Mutate the record to set the login date
CComplexStruct *pRecord = new CComplexStruct;
pRecord->SetElement(FIELD_LOGIN_FAILURE_COUNT, CDatum((int)1));
CComplexStruct *pMutation = new CComplexStruct;
pMutation->SetElement(FIELD_LAST_LOGIN_FAILURE_ON, MUTATE_DATE_MODIFIED);
pMutation->SetElement(FIELD_LOGIN_FAILURE_COUNT, MUTATE_INCREMENT);
// Create a payload
CComplexArray *pPayload = new CComplexArray;
pPayload->Insert(USERS_TABLE_NAME);
pPayload->Insert(m_sUsernameKey);
pPayload->Insert(CDatum(pRecord));
pPayload->Insert(CDatum(pMutation));
// Send message
ISessionHandler::SendMessageCommand(ADDRESS_AEON_COMMAND,
MSG_AEON_MUTATE,
GenerateAddress(PORT_CRYPTOSAUR_COMMAND),
CDatum(pPayload),
MESSAGE_TIMEOUT);
// Expect reply
return true;
}
示例15: Lock
void CMnemosynthDb::GenerateEndpointList (CDatum *retdList)
// GenerateEndpointList
//
// Returns data about all endpoints
{
CSmartLock Lock(m_cs);
int i;
CComplexArray *pList = new CComplexArray;
for (i = 0; i < m_Endpoints.GetCount(); i++)
{
CComplexStruct *pData = new CComplexStruct;
pData->SetElement(FIELD_ID, m_Endpoints[i].sName);
pData->SetElement(FIELD_SEQ_RECV, m_Endpoints[i].dwSeqRecv);
pData->SetElement(FIELD_SEQ_SENT, m_Endpoints[i].dwSeqSent);
pList->Append(CDatum(pData));
}
*retdList = CDatum(pList);
}