예제 #1
0
CSupplierDialog::~CSupplierDialog()
{
    if (IS_VALID_PTR(modelProducer))          { /*delete modelProducer;*/          modelProducer          = nullptr; }
    if (IS_VALID_PTR(modelSelectionProducer)) { /*delete modelSelectionProducer;*/ modelSelectionProducer = nullptr; }

    delete ui;
}
예제 #2
0
CLogisticMainWindow::~CLogisticMainWindow()
{
    if (IS_VALID_PTR(actionBar))     { delete actionBar;    actionBar    = nullptr; }
    if (IS_VALID_PTR(windowMapper))  { delete windowMapper; windowMapper = nullptr; }
    if (IS_VALID_PTR(mdiArea))       { delete mdiArea;      mdiArea      = nullptr; }
    if (IS_VALID_PTR(self))          { delete self;         self         = nullptr; }
}
예제 #3
0
 Binary::~Binary(){
     if (IS_VALID_PTR(binary)){
         delete binary;
     }
     if (IS_VALID_PTR(lineinfo)){
         delete lineinfo;
     }
 }
예제 #4
0
Positions::~Positions()
{
    if (IS_VALID_PTR(m_selectionModel))  {
        delete m_selectionModel;
        m_selectionModel  = nullptr;
    }
    if (IS_VALID_PTR(m_proxyModel))      {
        delete m_proxyModel;
        m_proxyModel      = nullptr;
    }
    if (IS_VALID_PTR(m_model))           {
        delete m_model;
        m_model           = nullptr;
    }
}
예제 #5
0
// **********************************************************
//			ClearDrawingLabelFrames()
// **********************************************************
void CMapView::ClearDrawingLabelFrames()
{
	// clear frames for drawing labels
	for (size_t j = 0; j < _activeDrawLists.size(); j++)
	{
		bool isSkip = false;
		for (size_t i = 0; i < _drawingLayerInvisilbe.size(); i++)
		{
			if (_drawingLayerInvisilbe[i] == j)
			{
				isSkip = true;	// skip if this layer is set invisible
				break;
			}
		}
		if (isSkip)
			continue;

		DrawList * dlist = _allDrawLists[_activeDrawLists[j]];
		if (IS_VALID_PTR(dlist))
		{
			CLabels* coLabels = static_cast<CLabels*>(dlist->m_labels);
			coLabels->ClearLabelFrames();
		}
	}
}
예제 #6
0
CCustomer::~CCustomer()
{
// drop #temporary table
    QString query ("DROP TABLE #GroupCustomerDiscounts"
                   "DROP TABLE #CustomerSubdiller");
    QSqlQuery temporary(currentDatabase());
    temporary.exec(query);

    if (IS_VALID_PTR(focusedWidget))        { delete focusedWidget;            focusedWidget  = nullptr;   }

    if (IS_VALID_PTR(customerDialog))       { delete customerDialog;           customerDialog = nullptr;   }
    if (IS_VALID_PTR(discountDialog))       { delete discountDialog;           discountDialog = nullptr;   }
    if (IS_VALID_PTR(customer_gDialog))     { delete customer_gDialog;         customer_gDialog = nullptr; }

    if (IS_VALID_PTR(ui))                   { delete ui;                       ui             = nullptr;   }
}
예제 #7
0
 SymbolTable::~SymbolTable(){
     if (IS_VALID_PTR(symbols)){
         while (symbols->size()){
             delete symbols->back();
             symbols->pop_back();
         }
         delete symbols;
     }
 }
예제 #8
0
void dumpConnectionMappingTable()
{
	#ifndef MAX_FQDN_SIZE
	#define MAX_FQDN_SIZE 256
	#endif
	char temp_ip[MAX_FQDN_SIZE];/*IP Address String buffer*/
	IMTCPMgr * ImInstance = IMTCPMgr::getInstance();


	// now the max num of peerid 255, if larger than that, code should change here 
	int16_t i,j,k;
	for( i = 0; i < POOL_TYPE_MAX; i++)
	{
		for( j = 0; j < POOL_ID_MAX; j++)
		{
			for( k = 0; k < FLOATER_NUMBER_MAX; k++)
			{
				ConMgrtbl* mgr_table;
				mgr_table = ImInstance->getPeerIdInfo((ImInstance->PoolIndex2pooltype(i)),j,k);
				if (IS_VALID_PTR(mgr_table) == FALSE)
				{
					_printf("mgr_table is invalid, mgr_table: %p", mgr_table);
					return;
				}
				if ( ImInstance->isIPValid(&mgr_table->peerid))
				{
					//OSip2arpa(const OSIPADDR *osip,char *buf,unsigned int size)
					OSIPADDR tmp_osip;
					tmp_osip.addrtype = OSIPV4;
					tmp_osip.ipaddr[0] = NTOH_32(mgr_table->peerIP);
					OSip2arpa( &tmp_osip, temp_ip, sizeof(temp_ip));

					_printf("pooltype is :%d, poolid is %d, poolmember is %d, IP is %s\n", i, j, k, temp_ip);
				}
			}
		}
	}
}
예제 #9
0
파일: dct_task.cpp 프로젝트: dekalo64/RLine
CTaskType::~CTaskType()
{
    if (IS_VALID_PTR(modelSelectionTask))  { delete modelSelectionTask;  modelSelectionTask  = nullptr; }
    if (IS_VALID_PTR(modelTask))           { delete modelTask;           modelTask           = nullptr; }
}
예제 #10
0
LogisticApplication::~LogisticApplication()
{
    if (database.isOpen()) { database.close(); }

    if (IS_VALID_PTR(positions))        {                        positions         = nullptr; }
    if (IS_VALID_PTR(tasktype))         {                        tasktype          = nullptr; }
    if (IS_VALID_PTR(contractortype))   {                        contractortype    = nullptr; }
    if (IS_VALID_PTR(status))           {                        status            = nullptr; }
    if (IS_VALID_PTR(priorities))       {                        priorities        = nullptr; }
    if (IS_VALID_PTR(countryandcity))   {                        countryandcity    = nullptr; }
    if (IS_VALID_PTR(suppliers))        {                        suppliers         = nullptr; }
    if (IS_VALID_PTR(customer))         {                        customer          = nullptr; }
//    if (IS_VALID_PTR(accountingoperation))       {                        accountingoperation        = nullptr; }

    if (IS_VALID_PTR(cntnDialog)) {                              cntnDialog        = nullptr; }
    if (IS_VALID_PTR(settings))         { delete settings;       settings          = nullptr; }
    if (IS_VALID_PTR(mainWnd))          {                        mainWnd           = nullptr; }
}
예제 #11
0
CContractorType::~CContractorType()
{
    if (IS_VALID_PTR(modelSelectionContractor)) { delete modelSelectionContractor; modelSelectionContractor  = nullptr; }
    if (IS_VALID_PTR(modelContractor))          { delete modelContractor;          modelContractor           = nullptr; }
}
예제 #12
0
파일: proc.c 프로젝트: 7h0ma5/kiss-avraprs
/**
 * Create a new process, starting at the provided entry point.
 *
 *
 * \note The function
 * \code
 * proc_new(entry, data, stacksize, stack)
 * \endcode
 * is a more convenient way to create a process, as you don't have to specify
 * the name.
 *
 * \return Process structure of new created process
 *         if successful, NULL otherwise.
 */
struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry)(void), iptr_t data, size_t stack_size, cpu_stack_t *stack_base)
{
	Process *proc;
	LOG_INFO("name=%s", name);
#if CONFIG_KERN_HEAP
	bool free_stack = false;

	/*
	 * Free up resources of a zombie process.
	 *
	 * We're implementing a kind of lazy garbage collector here for
	 * efficiency reasons: we can avoid to introduce overhead into another
	 * kernel task dedicated to free up resources (e.g., idle) and we're
	 * not introducing any overhead into the scheduler after a context
	 * switch (that would be *very* bad, because the scheduler runs with
	 * IRQ disabled).
	 *
	 * In this way we are able to release the memory of the zombie tasks
	 * without disabling IRQs and without introducing any significant
	 * overhead in any other kernel task.
	 */
	proc_freeZombies();

	/* Did the caller provide a stack for us? */
	if (!stack_base)
	{
		/* Did the caller specify the desired stack size? */
		if (!stack_size)
			stack_size = KERN_MINSTACKSIZE;

		/* Allocate stack dinamically */
		PROC_ATOMIC(stack_base =
			(cpu_stack_t *)heap_allocmem(&proc_heap, stack_size));
		if (stack_base == NULL)
			return NULL;

		free_stack = true;
	}

#else // CONFIG_KERN_HEAP

	/* Stack must have been provided by the user */
	ASSERT2(IS_VALID_PTR(stack_base), "Invalid stack pointer. Did you forget to \
		enable CONFIG_KERN_HEAP?");
	ASSERT2(stack_size, "Stack size cannot be 0.");

#endif // CONFIG_KERN_HEAP

#if CONFIG_KERN_MONITOR
	/*
	 * Fill-in the stack with a special marker to help debugging.
	 * On 64bit platforms, CONFIG_KERN_STACKFILLCODE is larger
	 * than an int, so the (int) cast is required to silence the
	 * warning for truncating its size.
	 */
	memset(stack_base, (int)CONFIG_KERN_STACKFILLCODE, stack_size);
#endif

	/* Initialize the process control block */
	if (CPU_STACK_GROWS_UPWARD)
	{
		proc = (Process *)stack_base;
		proc->stack = stack_base + PROC_SIZE_WORDS;
		// On some architecture stack should be aligned, so we do it.
		proc->stack = (cpu_stack_t *)((uintptr_t)proc->stack + (sizeof(cpu_aligned_stack_t) - ((uintptr_t)proc->stack % sizeof(cpu_aligned_stack_t))));
		if (CPU_SP_ON_EMPTY_SLOT)
			proc->stack++;
	}
	else
	{
		proc = (Process *)(stack_base + stack_size / sizeof(cpu_stack_t) - PROC_SIZE_WORDS);
		// On some architecture stack should be aligned, so we do it.
		proc->stack = (cpu_stack_t *)((uintptr_t)proc - ((uintptr_t)proc % sizeof(cpu_aligned_stack_t)));
		if (CPU_SP_ON_EMPTY_SLOT)
			proc->stack--;
	}
	/* Ensure stack is aligned */
	ASSERT((uintptr_t)proc->stack % sizeof(cpu_aligned_stack_t) == 0);

	stack_size -= PROC_SIZE_WORDS * sizeof(cpu_stack_t);
	proc_initStruct(proc);
	proc->user_data = data;

#if CONFIG_KERN_HEAP | CONFIG_KERN_MONITOR
	proc->stack_base = stack_base;
	proc->stack_size = stack_size;
	#if CONFIG_KERN_HEAP
	if (free_stack)
		proc->flags |= PF_FREESTACK;
	#endif
#endif
	proc->user_entry = entry;
	CPU_CREATE_NEW_STACK(proc->stack);

#if CONFIG_KERN_MONITOR
	monitor_add(proc, name);
#endif

	/* Add to ready list */
	ATOMIC(SCHED_ENQUEUE(proc));

	return proc;
}
예제 #13
0
 uint64_t Binary::getStartAddr(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->getStartAddr();
 }
예제 #14
0
 Function* Binary::getNextFunction(Function* f){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->getNextFunction(f);
 }
예제 #15
0
// ******************************************************************
//		Draw the DrawLayers
// ******************************************************************
void CMapView::DrawLists(const CRect & rcBounds, Gdiplus::Graphics* graphics, tkDrawReferenceList listType)
{
	// TODO: implement proper collision list for drawing labels; 
	// frames for drawing labels should be cleared from list while frames from the rest layers should remain 
	// in case Map.Refresh() was called
	CCollisionList collisionList;

	// label drawer for spatially referenced list
	CLabelDrawer lblDrawer(graphics, &_extents, _pixelPerProjectionX, _pixelPerProjectionY, 
		this->GetCurrentScale(), _currentZoom, &collisionList, _rotateAngle, _isSnapshot );
	
	// label drawer for screen referenced list
	Extent ext(rcBounds.left, rcBounds.right, rcBounds.top, rcBounds.bottom);
	CLabelDrawer lblDrawerScreen(graphics, &ext, &collisionList, _rotateAngle );

	std::vector<ILabels*> topLabels;	// labels that should be drawn above all layers
	std::vector<tkDrawReferenceList> labelsType;
	
	for(unsigned int j = 0; j < _activeDrawLists.size(); j++ )
	{
		bool isSkip = false;
		for (unsigned int i = 0; i < _drawingLayerInvisilbe.size(); i++)
		{
			if (_drawingLayerInvisilbe[i] == j)
			{
				isSkip = true;	// skip if this layer is set invisible
				break;  
			}
		}
		if(isSkip) 
		{
			continue;
		}

		DrawList * dlist = _allDrawLists[_activeDrawLists[j]];
		if( IS_VALID_PTR(dlist) )
		{
			if (dlist->listType == listType)
			{
                // the main drawing
				this->DrawDrawing( graphics, dlist);
				
				// labels
				ILabels* labels = dlist->m_labels;
				
				if(labels )
				{
					tkVerticalPosition vertPos;
					labels->get_VerticalPosition(&vertPos);
					if (vertPos == vpAboveParentLayer)		
					{
						if (dlist->listType == dlSpatiallyReferencedList)
						{
							lblDrawer.DrawLabels(labels);
						}
						else
						{
							lblDrawerScreen.DrawLabels(labels);
						}
					}
					else
					{
						topLabels.push_back(labels);
						labelsType.push_back(dlist->listType);
					}
				}
			}
		}
	}

	// draw labels above the other layers
	for (unsigned int i = 0; i < topLabels.size(); i++)
	{
		if (labelsType[i] == dlSpatiallyReferencedList)
		{
			lblDrawer.DrawLabels(topLabels[i]);
		}
		else
		{
			lblDrawerScreen.DrawLabels(topLabels[i]);
		}
	}
}
예제 #16
0
 bool Binary::isExecutable(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->isExecutable();
 }
예제 #17
0
 uint32_t Binary::countFunctions(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->countFunctions();
 }
예제 #18
0
 Function* Binary::findFunctionAt(uint64_t addr){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->findFunctionAt(addr);
 }
예제 #19
0
 bool Binary::isLastFunction(Function* f){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->isLastFunction(f);
 }
예제 #20
0
 std::string Binary::getName(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->getName();
 }
예제 #21
0
 uint32_t Binary::getFileSize(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->getFileSize();
 }
예제 #22
0
 Function* Binary::getFirstFunction(){
     EPAXAssert(IS_VALID_PTR(binary), "Binary is not valid");
     return binary->getFirstFunction();
 }
예제 #23
0
Priorities::~Priorities()
{
    if (IS_VALID_PTR(m_selectionModel))  { delete m_selectionModel;  m_selectionModel  = nullptr; }
    if (IS_VALID_PTR(m_proxymodel))      { delete m_proxymodel;      m_proxymodel      = nullptr; }
    if (IS_VALID_PTR(m_model))           { delete m_model;           m_model           = nullptr; }
}
예제 #24
0
 bool Binary::hasDebugLineInfo(){
     if (IS_VALID_PTR(lineinfo)){
         return lineinfo->hasInformation();
     }
     return false;
 }