コード例 #1
0
decaf::util::ArrayList< Pointer<ActiveMQDestination> > ActiveMQDestination::getCompositeDestinations() const {

    if (!this->compositeDestinations.isEmpty()) {
        return this->compositeDestinations;
    }

    if (this->isComposite()) {

        StlSet<std::string> components;
        StringTokenizer iter(this->physicalName, ActiveMQDestination::COMPOSITE_SEPARATOR);
        while (iter.hasMoreTokens()) {
            std::string name = trim(iter.nextToken());
            if (name.length() == 0) {
                continue;
            }
            components.add(name);
        }

        Pointer< Iterator<std::string> > iterator(components.iterator());
        while (iterator->hasNext()) {
            compositeDestinations.add(createDestination(iterator->next()));
        }
    }

    return this->compositeDestinations;
}
コード例 #2
0
ファイル: StlSet.cpp プロジェクト: ahinh93/Programs
StlSet StlSet::set_difference(const StlSet& a) const
{
	vector<int> result(getSize() + a.getSize());
	StlSet resultSet;
	
	vector<int>::iterator it =	std::set_difference(myset.begin(),myset.end(),a.myset.begin(),a.myset.end(),result.begin());
	
	result.resize(it-result.begin());
	
	for (int i=0;i<result.size();i++)
	{
		resultSet.add(result[i]);
	}
	
	return resultSet;
}