當前位置: 首頁>>代碼示例>>C++>>正文


C++ CBGetObject函數代碼示例

本文整理匯總了C++中CBGetObject函數的典型用法代碼示例。如果您正苦於以下問題:C++ CBGetObject函數的具體用法?C++ CBGetObject怎麽用?C++ CBGetObject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CBGetObject函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CBInitStringByCopyingCString

bool CBInitStringByCopyingCString(CBString * self,char * string){
	self->string = malloc(strlen(string));
	strcpy(self->string,string);
	if (!CBInitObject(CBGetObject(self)))
		return false;
	return true;
}
開發者ID:graingert,項目名稱:cbitcoin,代碼行數:7,代碼來源:CBString.c

示例2: CBInitByteArraySubReference

void CBInitByteArraySubReference(CBByteArray * self, CBByteArray * ref, uint32_t offset, uint32_t length) {
    CBInitObject(CBGetObject(self), false);
    self->sharedData = ref->sharedData;
    self->sharedData->references++; // Since a new reference to the shared data is being made, an increase in the reference count must be made.
    self->length = length;
    self->offset = ref->offset + offset;
}
開發者ID:josselin-c,項目名稱:cbitcoin,代碼行數:7,代碼來源:CBByteArray.c

示例3: CBNewStringByTakingCString

CBString * CBNewStringByTakingCString(char * string){
	objectNum++;
	CBString * self = malloc(sizeof(*self));
	CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateStringVT);
	CBInitStringByTakingCString(self,string);
	return self;
}
開發者ID:graingert,項目名稱:cbitcoin,代碼行數:7,代碼來源:CBString.c

示例4: CBNewScript

CBScript * CBNewScript(CBNetworkParameters * params,CBByteArray * program,CBEvents * events){
	CBScript * self = malloc(sizeof(*self));
	objectNum++;
	CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateScriptVT);
	CBInitScript(self,params,program,events);
	return self;
}
開發者ID:graingert,項目名稱:cbitcoin,代碼行數:7,代碼來源:CBScript.c

示例5: CBNewNode

CBNode * CBNewNode(CBDepObject database, CBNodeFlags flags, CBNodeCallbacks nodeCallbacks, CBNetworkCommunicatorCallbacks commCallbacks, CBOnMessageReceivedAction (*onMessageReceived)(CBNode *, CBPeer *, CBMessage *)){
	CBNode * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeNode;
	if (CBInitNode(self, database, flags, nodeCallbacks, commCallbacks, onMessageReceived))
		return self;
	free(self);
	return NULL;
}
開發者ID:favioflamingo,項目名稱:cbitcoin,代碼行數:8,代碼來源:CBNode.c

示例6: CBInitByteArrayWithData

void CBInitByteArrayWithData(CBByteArray * self, uint8_t * data, uint32_t size) {
    CBInitObject(CBGetObject(self), false);
    self->sharedData = malloc(sizeof(*self->sharedData));
    self->sharedData->data = data;
    self->sharedData->references = 1;
    self->length = size;
    self->offset = 0;
}
開發者ID:josselin-c,項目名稱:cbitcoin,代碼行數:8,代碼來源:CBByteArray.c

示例7: CBNewBlockHeadersFromData

CBBlockHeaders * CBNewBlockHeadersFromData(CBByteArray * data) {
	
	CBBlockHeaders * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeBlockHeaders;
	CBInitBlockHeadersFromData(self, data);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBBlockHeaders.c

示例8: CBNewBlockHeaders

CBBlockHeaders * CBNewBlockHeaders() {
	
	CBBlockHeaders * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeBlockHeaders;
	CBInitBlockHeaders(self);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBBlockHeaders.c

示例9: CBNewInventoryFromData

CBInventory * CBNewInventoryFromData(CBByteArray * data) {
	
	CBInventory * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeInventory;
	CBInitInventoryFromData(self, data);
	
	return self;
	
}
開發者ID:KBryan,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBInventory.c

示例10: CBNewInventory

CBInventory * CBNewInventory() {
	
	CBInventory * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeInventory;
	CBInitInventory(self);
	
	return self;
	
}
開發者ID:KBryan,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBInventory.c

示例11: CBInitByteArrayFromString

void CBInitByteArrayFromString(CBByteArray * self, char * string, bool terminator) {
    CBInitObject(CBGetObject(self), false);
    self->length = (uint32_t)(strlen(string) + terminator);
    self->sharedData = malloc(sizeof(*self->sharedData));
    self->sharedData->data = malloc(self->length);
    self->sharedData->references = 1;
    self->offset = 0;
    memcpy(self->sharedData->data, string, self->length);
}
開發者ID:josselin-c,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBByteArray.c

示例12: CBNewAlert

CBAlert * CBNewAlert(int32_t version, int64_t relayUntil, int64_t expiration, int32_t ID, int32_t cancel, int32_t minVer, int32_t maxVer, int32_t priority, CBByteArray * hiddenComment, CBByteArray * displayedComment, CBByteArray * reserved) {
	
	CBAlert * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeAlert;
	CBInitAlert(self, version, relayUntil, expiration, ID, cancel, minVer, maxVer, priority, hiddenComment, displayedComment, reserved);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBAlert.c

示例13: CBNewAlertFromData

CBAlert * CBNewAlertFromData(CBByteArray * data) {
	
	CBAlert * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeAlert;
	CBInitAlertFromData(self, data);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBAlert.c

示例14: CBNewPingPongFromData

CBPingPong * CBNewPingPongFromData(CBByteArray * data) {
	
	CBPingPong * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreePingPong;
	CBInitPingPongFromData(self, data);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBPingPong.c

示例15: CBNewPingPong

CBPingPong * CBNewPingPong(long long int ID) {
	
	CBPingPong * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreePingPong;
	CBInitPingPong(self, ID);
	
	return self;
	
}
開發者ID:01BTC10,項目名稱:cbitcoin,代碼行數:9,代碼來源:CBPingPong.c


注:本文中的CBGetObject函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。