Esempio n. 1
0
TInt CPropertyList::GetCustomProperty(TUid aPropertyId, TReal& aValue) const
	{
	TInt index = PropertyIndex(aPropertyId, Bookmark::EDataTypeReal);
	if (index == KErrNotFound)
		{
		return KErrNotFound;
		}

	TReal* realPtr = static_cast<TReal*>(iPropertyValues[index]);
	aValue = *realPtr;
	return KErrNone;
	}
Esempio n. 2
0
void CPropertyBase::GetPropertyValue(LPCTSTR Name, DWORD Phase, double T, double P, MPropertyValue & Value)
  {
  long i=PropertyIndex(Name);
  if (i>=0)
    {
    GetPropertyValue(i, Phase, T, P, Value);
    return;
    }
  CString S;
  S.Format("%s '%s' not valid", DefinedPropertyMapName(), Name);
  throw MMdlException(0, (LPCTSTR)S);
  };
Esempio n. 3
0
TInt CPropertyList::GetCustomProperty(TUid aPropertyId, TDes& aValue) const
	{
	TInt index = PropertyIndex(aPropertyId, Bookmark::EDataTypeDes16);
	if (index == KErrNotFound)
		{
		return KErrNotFound;
		}

	TDes* descPtr = static_cast<TDes*>(iPropertyValues[index]);
	if (aValue.MaxLength() < descPtr->Length())
		{
		return KErrArgument;
		}
	aValue = *descPtr;
	return KErrNone;
	}
Esempio n. 4
0
void CPropertyBase::PutPropertyValue(LPCTSTR Name, MPropertyValue & Value)
  {
  long i=PropertyIndex(Name);
  if (i>=0)
    {
    if (PropertyMap()[i]->Settable())
      PutPropertyValue(i, Value); 
    else
      {
      CString S;
      S.Format("%s '%s' not Settable", DefinedPropertyMapName(), Name);
      throw MMdlException(0, S);
      }
    }
  CString S;
  S.Format("%s '%s' not valid", DefinedPropertyMapName(), Name);
  throw MMdlException(0, (LPCTSTR)S);
  };
Esempio n. 5
0
void optimizerInit(void)
{
	assert(batRef == NULL);
	abortRef = putName("abort",5);
	affectedRowsRef = putName("affectedRows",12);
	aggrRef = putName("aggr",4);
	alarmRef = putName("alarm",5);
	algebraRef = putName("algebra",7);
	appendidxRef = putName("append_idxbat",13);
	appendRef = putName("append",6);
	assertRef = putName("assert",6);
	attachRef = putName("attach",6);
	avgRef = putName("avg",3);
	arrayRef = putName("array",4);
	batcalcRef = putName("batcalc",7);
	basketRef = putName("basket",6);
	boxRef = putName("box",3);
	batstrRef = putName("batstr",6);
	batmtimeRef = putName("batmtime",8);
	batmmathRef = putName("batmmath",8);
	batxmlRef = putName("batxml",6);
	bbpRef = putName("bbp",3);
	tidRef = putName("tid",3);
	deltaRef = putName("delta",5);
	subdeltaRef = putName("subdelta",8);
	projectdeltaRef = putName("projectdelta",12);
	binddbatRef = putName("bind_dbat",9);
	bindidxRef = putName("bind_idxbat",11);
	bindRef = putName("bind",4);
	bpmRef = putName("bpm",3);
	bstreamRef = putName("bstream",7);
	calcRef = putName("calc",4);
	catalogRef = putName("catalog",7);
	centipedeRef = putName("centipede",9);
	clear_tableRef = putName("clear_table",11);
	closeRef = putName("close",5);
	columnRef = putName("column",6);
	columnBindRef = putName("columnBind",10);
	commitRef = putName("commit",6);
	connectRef = putName("connect",7);
	constraintsRef = putName("constraints",11);
	countRef = putName("count",5);
	subcountRef = putName("subcount",8);
	copyRef = putName("copy",4);
	copy_fromRef = putName("copy_from",9);
	count_no_nilRef = putName("count_no_nil",12);
	crossRef = putName("crossproduct",12);
	createRef = putName("create",6);
	dateRef = putName("date",4);
	datacellRef = putName("datacell",8);
	dataflowRef = putName("dataflow",8);
	datacyclotronRef = putName("datacyclotron",13);
	dblRef = putName("dbl",3);
	deleteRef = putName("delete",6);
	depositRef = putName("deposit",7);
	differenceRef= putName("difference",10);
	tdifferenceRef= putName("tdifference",11);
	tintersectRef= putName("tintersect",10);
	tdiffRef= putName("tdiff",5);
	tinterRef= putName("tinter",6);
	mergecandRef= putName("mergecand",9);
	mergepackRef= putName("mergepack",9);
	intersectcandRef= putName("intersectcand",13);
	eqRef = putName("==",2);
	disconnectRef= putName("disconnect",10);
	evalRef = putName("eval",4);
	execRef = putName("exec",4);
	expandRef = putName("expand",6);
	exportOperationRef = putName("exportOperation",15);
	finishRef = putName("finish",6);
	firstnRef = putName("firstn",6);
	getRef = putName("get",3);
	generatorRef = putName("generator",9);
	grabRef = putName("grab",4);
	groupRef = putName("group",5);
	subgroupRef = putName("subgroup",8);
	subgroupdoneRef= putName("subgroupdone",12);
	groupsRef = putName("groups",6);
	groupbyRef = putName("groupby",7);
	hashRef = putName("hash",4);
	identityRef = putName("identity",8);
	ifthenelseRef = putName("ifthenelse",10);
	inplaceRef = putName("inplace",7);
	insertRef = putName("insert",6);
	intRef = putName("int",3);
	ioRef = putName("io",2);
	iteratorRef = putName("iterator",8);
	joinPathRef = putName("joinPath",8);
	joinRef = putName("join",4);
	antijoinRef = putName("antijoin",8);
	bandjoinRef = putName("bandjoin",8);
	thetajoinRef = putName("thetajoin",9);
	subjoinRef = putName("subjoin",7);
	subantijoinRef = putName("subantijoin",11);
	subbandjoinRef = putName("subbandjoin",11);
	subthetajoinRef = putName("subthetajoin",12);
	jsonRef = putName("json",4);
	kdifferenceRef= putName("kdifference",11);
	kunionRef= putName("kunion",6);
	languageRef= putName("language",8);
	leftfetchjoinRef = putName("leftfetchjoin",13);
	leftfetchjoinPathRef = putName("leftfetchjoinPath",17);
	leftjoinRef = putName("leftjoin",8);
	leftjoinPathRef = putName("leftjoinPath",12);
	likeselectRef = putName("like_select",11);
	ilikeselectRef = putName("ilike_select",12);
	likeuselectRef = putName("like_uselect",12);
	ilikeuselectRef = putName("ilike_uselect",13);
	listRef = putName("list",4);
	likeRef = putName("like",4);
	ilikeRef = putName("ilike",5);
	not_likeRef = putName("not_like",8);
	not_ilikeRef = putName("not_ilike",9);
	lockRef = putName("lock",4);
	lookupRef = putName("lookup",6);
	malRef = putName("mal", 3);
	mapiRef = putName("mapi", 4);
	markHRef = putName("markH", 5);
	markTRef = putName("markT", 5);
	mark_grpRef = putName("mark_grp", 8);
	materializeRef = putName("materialize", 11);
	mtimeRef = putName("mtime", 5);
	multicolumnRef = putName("multicolumn", 11);
	dense_rank_grpRef = putName("dense_rank_grp", 14);
	matRef = putName("mat", 3);
	max_no_nilRef = putName("max_no_nil", 10);
	maxRef = putName("max", 3);
	submaxRef = putName("submax", 6);
	submedianRef = putName("submedian", 9);
	mdbRef = putName("mdb", 3);
	min_no_nilRef = putName("min_no_nil", 10);
	minRef = putName("min", 3);
	subminRef = putName("submin", 6);
	mirrorRef = putName("mirror", 6);
	mitosisRef = putName("mitosis", 7);
	mkeyRef = putName("mkey", 4);
	mmathRef = putName("mmath", 5);
	multiplexRef = putName("multiplex", 9);
	manifoldRef = putName("manifold", 8);
	mvcRef = putName("mvc", 3);
	newRef = putName("new",3);
	notRef = putName("not",3);
	nextRef = putName("next",4);
	oidRef = putName("oid",3);
	octopusRef = putName("octopus",7);
	optimizerRef = putName("optimizer",9);
	openRef = putName("open",4);
	parametersRef = putName("parameters",10);
	packRef = putName("pack",4);
	pack2Ref = putName("pack2",5);
	passRef = putName("pass",4);
	partitionRef = putName("partition",9);
	pcreRef = putName("pcre",4);
	pinRef = putName("pin",3);
	plusRef = putName("+",1);
	minusRef = putName("-",1);
	mulRef = putName("*",1);
	divRef = putName("/",1);
	printRef = putName("print",5);
	preludeRef = putName("prelude",7);
	prodRef = putName("prod",4);
	subprodRef = putName("subprod",7);
	profilerRef = putName("profiler",8);
	postludeRef = putName("postlude",8);
	projectRef = putName("project",7);
	putRef = putName("put",3);
	querylogRef = putName("querylog",8);
	queryRef = putName("query",5);
	rankRef = putName("rank", 4);
	rank_grpRef = putName("rank_grp", 8);
	rapiRef = putName("batrapi", 7);
	reconnectRef = putName("reconnect",9);
	recycleRef = putName("recycle",7);
	refineRef = putName("refine",6);
	refine_reverseRef = putName("refine_reverse",14);
	registerRef = putName("register",8);
	remapRef = putName("remap",5);
	remoteRef = putName("remote",6);
	replaceRef = putName("replace",7);
	replicatorRef = putName("replicator",10);
	resultSetRef = putName("resultSet",9);
	reuseRef = putName("reuse",5);
	reverseRef = putName("reverse",7);
	rpcRef = putName("rpc",3);
	rsColumnRef = putName("rsColumn",8);
	schedulerRef = putName("scheduler",9);
	selectNotNilRef = putName("selectNotNil",12);
	seriesRef = putName("series",6);
	semaRef = putName("sema",4);
	semijoinRef = putName("semijoin",8);
	semijoinPathRef = putName("semijoinPath",12);
	setAccessRef = putName("setAccess",9);
	setWriteModeRef= putName("setWriteMode",12);
	sinkRef = putName("sink",4);
	sliceRef = putName("slice",5);
	subsliceRef = putName("subslice",8);
	singleRef = putName("single",6);
	sortHRef = putName("sortH",5);
	sortHTRef = putName("sortHT",6);
	sortRef = putName("sort",4);
	sortReverseTailRef = putName("sortReverseTail",15);
	sortTailRef = putName("sortTail",8);
	sortTHRef = putName("sortTH",6);
	sqlRef = putName("sql",3);
	srvpoolRef = putName("srvpool",7);
	streamsRef = putName("streams",7);
	startRef = putName("start",5);
	stopRef = putName("stop",4);
	strRef = putName("str",3);
	sumRef = putName("sum",3);
	subsumRef = putName("subsum",6);
	subavgRef = putName("subavg",6);
	subsortRef = putName("subsort",7);
	takeRef= putName("take",5);
	timestampRef = putName("timestamp", 9);
	not_uniqueRef= putName("not_unique",10);
	unlockRef= putName("unlock",6);
	unpackRef = putName("unpack",6);
	unpinRef = putName("unpin",5);
	updateRef = putName("update",6);
	subselectRef = putName("subselect",9);
	thetasubselectRef = putName("thetasubselect",14);
	likesubselectRef = putName("likesubselect",13);
	ilikesubselectRef = putName("ilikesubselect",14);
	vectorRef = putName("vector",6);
	zero_or_oneRef = putName("zero_or_one",11);
	userRef = putName("user",4);

	canBeCrackedProp = PropertyIndex("canBeCracked");
	canBeJoinselectProp = PropertyIndex("canBeJoinselect");
	sidewaysSelectProp = PropertyIndex("sidewaysSelect");
	headProp = PropertyIndex("head");
	pivotProp = PropertyIndex("pivot");
	pivotDisjunctiveProp = PropertyIndex("pivotDisjunctive");
	removeProp = PropertyIndex("remove");
	tableProp = PropertyIndex("table");

	fileProp = PropertyIndex("file");
	inlineProp = PropertyIndex("inline");
	keepProp = PropertyIndex("keep");
	notnilProp = PropertyIndex("notnil");
	rowsProp = PropertyIndex("rows");
	runonceProp = PropertyIndex("runonce");
	unsafeProp = PropertyIndex("unsafe");
	sqlfunctionProp = PropertyIndex("sqlfunction");

	stableProp = PropertyIndex("stableProp");
	insertionsProp = PropertyIndex("insertionsProp");
	updatesProp = PropertyIndex("updatesProp");
	deletesProp = PropertyIndex("deletesProp");

	hlbProp = PropertyIndex("hlb");
	hubProp = PropertyIndex("hub");
	tlbProp = PropertyIndex("tlb");
	tubProp = PropertyIndex("tub");

	horiginProp = PropertyIndex("horigin");
	toriginProp = PropertyIndex("torigin");
	/*
	 * @-
	 * Set the optimizer debugging flag
	 */
	{
		int ret;
		str ref= GDKgetenv("opt_debug");
		if ( ref)
			OPTsetDebugStr(&ret,&ref);
	}

	batRef = putName("bat",3);
}
/**
 *	This function returns the PropertyIndex that corresponds
 *	to the provided index.
 *
 *	@param index The index from the right click menu
 *	@return The PropertyIndex
 */
PropertyIndex PropertiesHelper::commandIndex( int index )
{
	if ( propMap_.find( index ) != propMap_.end() )
		return propMap_[index];
	return PropertyIndex(-1);
}
/**
 *	Builds a list of commands for the right click on Editor Chunk Item operation.
 *
 *	@return Returns the list of commands.
 */
std::vector<std::string> PropertiesHelper::command()
{
	propMap_.clear();

	std::vector<std::string> links;
	int index = 0;
	for (int i=0; i < propCount(); i++)
	{
		DataDescription* pDD = pType()->property( i );
		if (!pDD->editable())
			continue;

		if ( isUserDataObjectLink(i) )
		{
			PyObjectPtr ob( propGetPy( i ), PyObjectPtr::STEAL_REFERENCE );
			
			std::string uniqueId = PyString_AsString( PyTuple_GetItem( ob.getObject(), 0 ) );
			if ( !uniqueId.empty() )
			{
				links.push_back( "#"+propName(i) );
				links.push_back( "#"+uniqueId );
				links.push_back( "Delete Link" );
				propMap_[index++] = PropertyIndex( i );
				links.push_back( "##" );
				links.push_back( "##" );
			}
		}
		else if ( isUserDataObjectLinkArray(i) )
		{
			PyObjectPtr ob( propGetPy( i ), PyObjectPtr::STEAL_REFERENCE );

			SequenceDataType* dataType =
				static_cast<SequenceDataType*>( pDD->dataType() );
			ArrayPropertiesHelper propArray;
			propArray.init( pItem(), &(dataType->getElemType()), ob.getObject());

			int numProps = propArray.propCount();
			if ( numProps > 0 )
			{
				links.push_back( "#"+propName(i) );
				links.push_back( "Delete All" );
				propMap_[index++] = PropertyIndex( i );
				links.push_back( "" );
				// Iterate through the array of links
				for(int j = 0; j < numProps; j++)
				{
					PyObjectPtr link( propArray.propGetPy( j ), PyObjectPtr::STEAL_REFERENCE );
					std::string uniqueId = PyString_AsString( PyTuple_GetItem( link.getObject(), 0 ) );
					if ( !uniqueId.empty() )
					{
						links.push_back( "#"+uniqueId );
						links.push_back( "Delete Link" );
						PropertyIndex pi( i );
						pi.append( j );
						propMap_[index++] = pi;
						links.push_back( "##" );
					}
				}
				links.push_back( "##" );
			}
		}
	}	
	return links;
}