text:
package org.apache.ignite.testsuites;

import java.util.Set;
import junit.framework.TestSuite;
import org.apache.ignite.cache.IgniteWarmupClosureSelfTest;
import org.apache.ignite.cache.store.GridCacheBalancingStoreSelfTest;
import org.apache.ignite.cache.store.GridCacheLoadOnlyStoreAdapterSelfTest;
import org.apache.ignite.cache.store.StoreResourceInjectionSelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreBinaryMarshallerSelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreBinaryMarshallerStoreKeepBinarySelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreBinaryMarshallerStoreKeepBinaryWithSqlEscapeSelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreBinaryMarshallerWithSqlEscapeSelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreMultitreadedSelfTest;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreTest;
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreMultithreadedSelfTest;
import org.apache.ignite.cache.store.jdbc.GridCacheJdbcBlobStoreSelfTest;
import org.apache.ignite.cache.store.jdbc.JdbcTypesDefaultTransformerTest;
import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesMultipleConnectionsTest;
import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesTest;
import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalanceMultipleConnectionsTest;
import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalancePairedConnectionsTest;
import org.apache.ignite.internal.managers.communication.IgniteCommunicationBalanceTest;
import org.apache.ignite.internal.managers.communication.IgniteIoTestMessagesTest;
import org.apache.ignite.internal.managers.communication.IgniteVariousConnectionNumberTest;
import org.apache.ignite.internal.processors.cache.CacheAffinityCallSelfTest;
import org.apache.ignite.internal.processors.cache.CacheDeferredDeleteQueueTest;
import org.apache.ignite.internal.processors.cache.CacheDeferredDeleteSanitySelfTest;
import org.apache.ignite.internal.processors.cache.CacheFutureExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.CacheNamesSelfTest;
import org.apache.ignite.internal.processors.cache.CacheNamesWithSpecialCharactersTest;
import org.apache.ignite.internal.processors.cache.CachePutEventListenerErrorSelfTest;
import org.apache.ignite.internal.processors.cache.CacheTxFastFinishTest;
import org.apache.ignite.internal.processors.cache.GridCacheAffinityApiSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheAffinityMapperSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheAffinityRoutingSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheAsyncOperationsLimitSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheClearAllSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheColocatedTxStoreExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheConcurrentMapSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheConfigurationConsistencySelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheConfigurationValidationSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheEntryMemorySizeSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheLifecycleAwareSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheLocalTxStoreExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheMissingCommitVersionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheMixedPartitionExchangeSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheMvccManagerSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheMvccPartitionedSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheMvccSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheNearTxStoreExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheObjectToStringSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheOffHeapAtomicMultiThreadedUpdateSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheOffHeapMultiThreadedUpdateSelfTest;
import org.apache.ignite.internal.processors.cache.GridCachePartitionedLocalStoreSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheReplicatedLocalStoreSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheReplicatedTxStoreExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheStopSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheStorePutxSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheStoreValueBytesSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheSwapPreloadSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheTtlManagerSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheTxPartitionedLocalStoreSelfTest;
import org.apache.ignite.internal.processors.cache.GridMemoryConfigurationConsistencySelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicLocalInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicLocalWithStoreInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicNearEnabledInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicWithStoreInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheAtomicStopBusySelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerAtomicLocalTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerAtomicReplicatedTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerAtomicTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerEagerTtlDisabledTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerTxLocalTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerTxReplicatedTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryListenerTxTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheEntryProcessorCallTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheManyAsyncOperationsTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheNearLockValueSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheTransactionalStopBusySelfTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheTxInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheTxLocalInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteCacheTxNearEnabledInvokeTest;
import org.apache.ignite.internal.processors.cache.IgniteClientAffinityAssignmentSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteIncompleteCacheObjectSelfTest;
import org.apache.ignite.internal.processors.cache.IgnitePutAllLargeBatchSelfTest;
import org.apache.ignite.internal.processors.cache.IgnitePutAllUpdateNonPreloadedPartitionSelfTest;
import org.apache.ignite.internal.processors.cache.IgniteTxConfigCacheSelfTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheAtomicExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheContinuousExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheIsolatedExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheP2PDisableExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCachePartitionedExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCachePrivateExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheReplicatedExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheSharedExecutionContextTest;
import org.apache.ignite.internal.processors.cache.context.IgniteCacheTxExecutionContextTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheAtomicNearUpdateTopologyChangeTest;
import org.apache.ignite.internal.processors.cache.distributed.CacheTxNearUpdateTopologyChangeTest;
import org.apache.ignite.internal.processors.cache.distributed.GridCacheEntrySetIterationPreloadingSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecovery10ConnectionsTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecoveryPairedConnectionsTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheAtomicMessageRecoveryTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheConnectionRecovery10ConnectionsTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheConnectionRecoveryTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheMessageRecoveryIdleConnectionTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheMessageWriteTimeoutTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheSystemTransactionsSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCacheTxMessageRecoveryTest;
import org.apache.ignite.internal.processors.cache.distributed.IgniteCrossCacheTxStoreSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheAtomicNearCacheSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheColocatedTxExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheGlobalLoadTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheGetStoreErrorSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheNearTxExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.replicated.GridCacheReplicatedTxExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.local.GridCacheLocalTxExceptionSelfTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheEntryProcessorExternalizableFailedTest;
import org.apache.ignite.internal.processors.cache.query.continuous.CacheEntryProcessorNonSerializableTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamerImplSelfTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamerMultiThreadedSelfTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamerMultinodeCreateCacheTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamerTimeoutTest;
import org.apache.ignite.internal.processors.datastreamer.DataStreamerUpdateAfterLoadTest;
import org.apache.ignite.testframework.GridTestUtils;

/**
 * Test suite.
 */
public class IgniteCacheTestSuite extends TestSuite {
    /**
     * @return IgniteCache test suite.
     * @throws Exception Thrown in case of the failure.
     */
    public static TestSuite suite() throws Exception {
        return suite(null);
    }

    /**
     * @param ignoredTests Tests to ignore.
     * @return Test suite.
     * @throws Exception Thrown in case of the failure.
     */
    public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
        TestSuite suite = new TestSuite("IgniteCache Test Suite");

        suite.addTestSuite(IgniteCacheEntryListenerAtomicTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerAtomicReplicatedTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerAtomicLocalTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxReplicatedTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerTxLocalTest.class);
        suite.addTestSuite(IgniteCacheEntryListenerEagerTtlDisabledTest.class);

        suite.addTestSuite(IgniteClientAffinityAssignmentSelfTest.class);

        suite.addTestSuite(IgniteCacheAtomicInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicNearEnabledInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicWithStoreInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicLocalInvokeTest.class);
        suite.addTestSuite(IgniteCacheAtomicLocalWithStoreInvokeTest.class);
        suite.addTestSuite(IgniteCacheTxInvokeTest.class);
        suite.addTestSuite(CacheEntryProcessorNonSerializableTest.class);
        suite.addTestSuite(CacheEntryProcessorExternalizableFailedTest.class);
        suite.addTestSuite(IgniteCacheEntryProcessorCallTest.class);
        suite.addTestSuite(IgniteCacheTxNearEnabledInvokeTest.class);
        suite.addTestSuite(IgniteCacheTxLocalInvokeTest.class);
        suite.addTestSuite(IgniteCrossCacheTxStoreSelfTest.class);

        // TODO GG-11148: include test when implemented.
        // Test fails due to incorrect handling of CacheConfiguration#getCopyOnRead() and
        // CacheObjectContext#storeValue() properties. Heap storage should be redesigned in this ticket.
        //GridTestUtils.addTestIfNeeded(suite, CacheEntryProcessorCopySelfTest.class, ignoredTests);

        suite.addTestSuite(IgnitePutAllLargeBatchSelfTest.class);
        suite.addTestSuite(IgnitePutAllUpdateNonPreloadedPartitionSelfTest.class);

        // User's class loader tests.
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheAtomicExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCachePartitionedExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheReplicatedExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheTxExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheContinuousExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheIsolatedExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheP2PDisableExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCachePrivateExecutionContextTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, IgniteCacheSharedExecutionContextTest.class, ignoredTests);

        // Warmup closure tests.
        suite.addTestSuite(IgniteWarmupClosureSelfTest.class);

        // Swap tests.
        suite.addTestSuite(GridCacheSwapPreloadSelfTest.class);

        // Common tests.
        suite.addTestSuite(CacheNamesSelfTest.class);
        suite.addTestSuite(CacheNamesWithSpecialCharactersTest.class);
        suite.addTestSuite(GridCacheConcurrentMapSelfTest.class);
        suite.addTestSuite(GridCacheAffinityMapperSelfTest.class);
        suite.addTestSuite(CacheAffinityCallSelfTest.class);
        GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityRoutingSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, GridCacheMvccSelfTest.class, ignoredTests);
        suite.addTestSuite(GridCacheMvccPartitionedSelfTest.class);
        suite.addTestSuite(GridCacheMvccManagerSelfTest.class);
        // TODO GG-11141.
        // suite.addTestSuite(GridCacheP2PUndeploySelfTest.class);
        suite.addTestSuite(GridCacheConfigurationValidationSelfTest.class);
        suite.addTestSuite(GridCacheConfigurationConsistencySelfTest.class);
        suite.addTestSuite(GridMemoryConfigurationConsistencySelfTest.class);
        suite.addTestSuite(GridCacheJdbcBlobStoreSelfTest.class);
        suite.addTestSuite(GridCacheJdbcBlobStoreMultithreadedSelfTest.class);
        suite.addTestSuite(JdbcTypesDefaultTransformerTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreBinaryMarshallerSelfTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreBinaryMarshallerStoreKeepBinarySelfTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreBinaryMarshallerWithSqlEscapeSelfTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreBinaryMarshallerStoreKeepBinaryWithSqlEscapeSelfTest.class);
        suite.addTestSuite(CacheJdbcPojoStoreMultitreadedSelfTest.class);
        suite.addTestSuite(GridCacheBalancingStoreSelfTest.class);
        suite.addTestSuite(GridCacheAffinityApiSelfTest.class);
        suite.addTestSuite(GridCacheStoreValueBytesSelfTest.class);
        GridTestUtils.addTestIfNeeded(suite, DataStreamProcessorSelfTest.class, ignoredTests);
        GridTestUtils.addTestIfNeeded(suite, DataStreamerUpdateAfterLoadTest.class, ignoredTests);
        suite.addTestSuite(DataStreamerMultiThreadedSelfTest.class);
        suite.addTestSuite(DataStreamerMultinodeCreateCacheTest.class);
        suite.addTestSuite(DataStreamerImplSelfTest.class);
        suite.addTestSuite(DataStreamerTimeoutTest.class);
        GridTestUtils.addTestIfNeeded(suite, GridCacheEntryMemorySizeSelfTest.class, ignoredTests);
        suite.addTestSuite(GridCacheClearAllSelfTest.class);
        suite.addTestSuite(GridCacheObjectToStringSelfTest.class);
        suite.addTestSuite(GridCacheLoadOnlyStoreAdapterSelfTest.class);
        suite.addTestSuite(GridCacheGetStoreErrorSelfTest.class);
        suite.addTestSuite(StoreResourceInjectionSelfTest.class);
        suite.addTestSuite(CacheFutureExceptionSelfTest.class);
        suite.addTestSuite(GridCacheAsyncOperationsLimitSelfTest.class);
        suite.addTestSuite(IgniteCacheManyAsyncOperationsTest.class);
        suite.addTestSuite(GridCacheTtlManagerSelfTest.class);
        // TODO: ignite-4534
//        suite.addTestSuite(GridCacheTtlManagerEvictionSelfTest.class);
        suite.addTestSuite(GridCacheLifecycleAwareSelfTest.class);
        suite.addTestSuite(IgniteCacheAtomicStopBusySelfTest.class);
        suite.addTestSuite(IgniteCacheTransactionalStopBusySelfTest.class);
        suite.addTestSuite(GridCacheAtomicNearCacheSelfTest.class);
        suite.addTestSuite(CacheAtomicNearUpdateTopologyChangeTest.class);
        suite.addTestSuite(CacheTxNearUpdateTopologyChangeTest.class);
        suite.addTestSuite(GridCacheStorePutxSelfTest.class);
        suite.addTestSuite(GridCacheOffHeapMultiThreadedUpdateSelfTest.class);
        suite.addTestSuite(GridCacheOffHeapAtomicMultiThreadedUpdateSelfTest.class);
        suite.addTestSuite(GridCacheColocatedTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheLocalTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheNearTxStoreExceptionSelfTest.class);
        suite.addTestSuite(GridCacheMissingCommitVersionSelfTest.class);
        suite.addTestSuite(GridCacheEntrySetIterationPreloadingSelfTest.class);
        suite.addTestSuite(GridCacheMixedPartitionExchangeSelfTest.class);
        suite.addTestSuite(IgniteCacheAtomicMessageRecoveryTest.class);
        suite.addTestSuite(IgniteCacheAtomicMessageRecoveryPairedConnectionsTest.class);
        suite.addTestSuite(IgniteCacheAtomicMessageRecovery10ConnectionsTest.class);
        suite.addTestSuite(IgniteCacheTxMessageRecoveryTest.class);
        suite.addTestSuite(IgniteCacheMessageWriteTimeoutTest.class);
        suite.addTestSuite(IgniteCacheMessageRecoveryIdleConnectionTest.class);
        suite.addTestSuite(IgniteCacheConnectionRecoveryTest.class);
        suite.addTestSuite(IgniteCacheConnectionRecovery10ConnectionsTest.class);
        suite.addTestSuite(GridCacheGlobalLoadTest.class);
        suite.addTestSuite(GridCachePartitionedLocalStoreSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedLocalStoreSelfTest.class);
        suite.addTestSuite(GridCacheTxPartitionedLocalStoreSelfTest.class);
        suite.addTestSuite(IgniteCacheSystemTransactionsSelfTest.class);
        suite.addTestSuite(CacheDeferredDeleteSanitySelfTest.class);
        suite.addTestSuite(CacheDeferredDeleteQueueTest.class);

        suite.addTest(IgniteCacheTcpClientDiscoveryTestSuite.suite());

        // Heuristic exception handling.
        suite.addTestSuite(GridCacheColocatedTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheReplicatedTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheLocalTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheNearTxExceptionSelfTest.class);
        suite.addTestSuite(GridCacheStopSelfTest.class);

        suite.addTestSuite(IgniteCacheNearLockValueSelfTest.class);

        suite.addTestSuite(CachePutEventListenerErrorSelfTest.class);

        suite.addTestSuite(IgniteTxConfigCacheSelfTest.class);

        suite.addTestSuite(CacheTxFastFinishTest.class);

        suite.addTestSuite(IgniteVariousConnectionNumberTest.class);
        suite.addTestSuite(IgniteCommunicationBalanceTest.class);
        suite.addTestSuite(IgniteCommunicationBalancePairedConnectionsTest.class);
        suite.addTestSuite(IgniteCommunicationBalanceMultipleConnectionsTest.class);
        suite.addTestSuite(IgniteIoTestMessagesTest.class);
        suite.addTestSuite(IgniteDiagnosticMessagesTest.class);
        suite.addTestSuite(IgniteDiagnosticMessagesMultipleConnectionsTest.class);

        suite.addTestSuite(IgniteIncompleteCacheObjectSelfTest.class);

        return suite;
    }
}


text:
<?php

namespace PHPExiftool\Driver\Tag\DICOM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class CylinderPower extends AbstractTag
{

    protected $Id = '0046,0147';

    protected $Name = 'CylinderPower';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Cylinder Power';
}

redpajama_set_name: RedPajamaGithub


text:
"Ideogenesis: Database setup; indexes and constraints."

from __future__ import print_function, absolute_import

import logging
import json

from ideogenesis import constants
from ideogenesis import settings
from ideogenesis import utils

def setup(neo4j):
    "Create uniqeness constraints if not done."
    ensure_uniqueness(neo4j, 'Any',    'iuid')
    ensure_uniqueness(neo4j, 'User',   'username_normalized')
    ensure_uniqueness(neo4j, 'User',   'email')
    ensure_uniqueness(neo4j, 'Person', 'name_normalized')
    ensure_index(neo4j, 'Person', 'sortname')
    ensure_index(neo4j, 'Person', 'shortname')
    ensure_uniqueness(neo4j, 'Text',   'title_normalized')
    ensure_uniqueness(neo4j, 'Info',   'path')

def ensure_uniqueness(neo4j, label, property_key):
    url = neo4j.get_url('constraints', "{}/uniqueness".format(label))
    response = neo4j.session.get(url)
    neo4j.check_http(response, 200)
    if exists_uniqueness(response.json(), label, [property_key]):
        logging.info("Uniqueness constraint for {}:{} exists".format(
                label, property_key))
    else:
        data = json.dumps(dict(property_keys=[property_key]))
        response = neo4j.session.post(url, data=data)
        neo4j.check_http(response, 200)
        logging.info("Created uniqueness constraint for {}:{}".format(
                label, property_key))

def exists_uniqueness(data, label, property_keys):
    "Does a uniqueness constraint exist for the given label and property keys?"
    for item in data:
        if item['label'] != label: continue
        if item['type'] != 'UNIQUENESS': continue
        if set(item['property_keys']) == set(property_keys): return True
    return False

def ensure_index(neo4j, label, property_key):
    url = neo4j.get_url('indexes', label)
    response = neo4j.session.get(url)
    neo4j.check_http(response, 200)
    if exists_index(response.json(), label, [property_key]):
        logging.info("Index for {}:{} exists".format(label, property_key))
    else:
        data = json.dumps(dict(property_keys=[property_key]))
        response = neo4j.session.post(url, data=data)
        neo4j.check_http(response, 200)
        logging.info("Created index for {}:{}".format(label, property_key))

def exists_index(data, label, property_keys):
    "Does an index exist for the given label and property keys?"
    for item in data:
        if item['label'] != label: continue
        if set(item['property_keys']) == set(property_keys): return True
    return False

if __name__ == '__main__':
    args = utils.get_args(description='Ideogenesis db index setup')
    utils.load_settings(filepath=args.settings, verbose=args.verbose)
    neo4j = utils.get_neo4j(check=True)
    print('Neo4j server', neo4j.version)
    setup(neo4j)


text:
package org.apache.crunch.scrunch

import org.apache.crunch.{PObject => JPObject}
import org.apache.crunch.Target

/**
 * Represents a singleton value that results from a distributed computation.
 *
 * @param native The Java PObject that backs this Scala PObject.
 * @tparam T The type of value encapsulated by this PObject.
 */
class PObject[T] private (private val native: JPObject[T]) {
  /**
   * Gets the value associated with this PObject.  Calling this method will trigger
   * whatever computation is necessary to obtain the value and block until that computation
   * succeeds.
   *
   * @return The value associated with this PObject.
   */
  def value(): T = native.getValue()
}

/**
 * The companion object for PObject that provides factory methods for creating PObjects.
 */
protected[scrunch] object PObject {

  /**
   * Creates a new Scala PObject from a Java PObject.
   *
   * @param native The Java PObject that will back this Scala PObject.
   * @tparam T The type of value encapsulated by the PObject.
   * @return A Scala PObject backed by the Java PObject specified.
   */
  def apply[T](native: JPObject[T]): PObject[T] = new PObject[T](native)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2011 JBoss Inc
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~         http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  -->
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:b='urn:import:org.gwtbootstrap3.client.ui'
             xmlns:kw='urn:import:org.drools.workbench.screens.workitems.client.widget'>

  <ui:style>
    .editorContainer {
      position: absolute;
      bottom: 0;
      top: 0;
      right: 0;
    }
  </ui:style>

  <b:Container fluid="true">
    <b:Row ui:field="row">
      <b:Column size="MD_2">
        <kw:WorkItemDefinitionElementsBrowser ui:field="workItemBrowser"/>
      </b:Column>
      <b:Column size="MD_10" addStyleNames="{style.editorContainer}" ui:field="editorContainer">
        <kw:WorkItemDefinitionEditor ui:field="workItemWidget"/>
      </b:Column>
    </b:Row>
  </b:Container>

</ui:UiBinder>


text:
package dk.cmol.tetris.figures;

import android.graphics.Point;

public class FigII extends Figure {
	public FigII(int xStart) {
		figBricksOriginal.add(new Point(-1,-1));
		figBricksOriginal.add(new Point(-1, 0));
		figBricksOriginal.add(new Point(-1, 1));
		figBricksOriginal.add(new Point(-1, 2));
		figBricksOriginal.add(new Point( 1,-1));
		figBricksOriginal.add(new Point( 1, 0));
		figBricksOriginal.add(new Point( 1, 1));
		figBricksOriginal.add(new Point( 1, 2));

		reset(xStart);
		brickColor = Colors.CYAN;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Resources.Core;

namespace SuperMap.WinRT.Resources
{
    public class ExceptionStrings
    {
        private static ResourceMap resourceStringMap = ResourceManager.Current.MainResourceMap.GetSubtree("SuperMap.WinRT/ExceptionStrings");

        public static string String1
        {
            get
            {
                return resourceStringMap.GetValue("String1").ValueAsString;
            }
        }
        /// <summary>
        ///   查找类似 该元素附加项属性ElementsLayer.BBox没有设置 的本地化字符串。
        /// </summary>
        public static string BboxIsNotSet
        {
            get
            {
                return resourceStringMap.GetValue("BboxIsNotSet").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 不能将Feature加到多个FeaturesLayer上 的本地化字符串。
        /// </summary>
        public static string CanntAddToMFLayer
        {
            get
            {
                return resourceStringMap.GetValue("CanntAddToMFLayer").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 CRS为空 的本地化字符串。
        /// </summary>
        public static string CRSIsNull
        {
            get
            {
                return resourceStringMap.GetValue("CRSIsNull").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 目标类型为空 的本地化字符串。
        /// </summary>
        public static string DestinationTypeIsNull
        {
            get
            {
                return resourceStringMap.GetValue("DestinationTypeIsNull").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 ElementsLayer单独使用时无法添加ShapeBase。 的本地化字符串。
        /// </summary>
        public static string ElementsLayerIsAlone
        {
            get
            {
                return resourceStringMap.GetValue("ElementsLayerIsAlone").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 高度将小于0 的本地化字符串。
        /// </summary>
        public static string HeightLessThanZero
        {
            get
            {
                return resourceStringMap.GetValue("HeightLessThanZero").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 Map的尺度设置与TiledLayer尺度设置不匹配 的本地化字符串。
        /// </summary>
        public static string InvalidMatch
        {
            get
            {
                return resourceStringMap.GetValue("InvalidMatch").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 MultiplicationConverter不支持该类型 {0} 的本地化字符串。
        /// </summary>
        public static string InvalidMultiplicationConverter
        {
            get
            {
                return resourceStringMap.GetValue("InvalidMultiplicationConverter").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 分辨率数组不能设置为空 的本地化字符串。
        /// </summary>
        public static string InvalidResolutions
        {
            get
            {
                return resourceStringMap.GetValue("InvalidResolutions").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 比例尺数组不能设置为空 的本地化字符串。
        /// </summary>
        public static string InvalidScales
        {
            get
            {
                return resourceStringMap.GetValue("InvalidScales").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 无法转换为String Array 的本地化字符串。
        /// </summary>
        public static string InvalidStringArray
        {
            get
            {
                return resourceStringMap.GetValue("InvalidStringArray").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 暂不支持该Geometry类型 的本地化字符串。
        /// </summary>
        public static string InvalidSupportGeometry
        {
            get
            {
                return resourceStringMap.GetValue("InvalidSupportGeometry").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 无法成功转换为CoordinateReferenceSystem 的本地化字符串。
        /// </summary>
        public static string InvalidToCRS
        {
            get
            {
                return resourceStringMap.GetValue("InvalidToCRS").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 无法成功转换为DoubleArray 的本地化字符串。
        /// </summary>
        public static string InvalidToDoubleArray
        {
            get
            {
                return resourceStringMap.GetValue("InvalidToDoubleArray").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 无效的URI模式宿主 的本地化字符串。
        /// </summary>
        public static string InvalidURISchemeHost
        {
            get
            {
                return resourceStringMap.GetValue("InvalidURISchemeHost").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 强烈程度的范围大于1或者小于0 的本地化字符串。
        /// </summary>
        public static string IvalidIntensity
        {
            get
            {
                return resourceStringMap.GetValue("IvalidIntensity").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 该Layer已经隶属于其他Map 的本地化字符串。
        /// </summary>
        public static string LayerToMap
        {
            get
            {
                return resourceStringMap.GetValue("LayerToMap").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 请求繁忙 的本地化字符串。
        /// </summary>
        public static string OperationIsBusy
        {
            get
            {
                return resourceStringMap.GetValue("OperationIsBusy").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 参数错误 的本地化字符串。
        /// </summary>
        public static string ParametersError
        {
            get
            {
                return resourceStringMap.GetValue("ParametersError").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 文本解析失败 的本地化字符串。
        /// </summary>
        public static string ParseFailed
        {
            get
            {
                return resourceStringMap.GetValue("ParseFailed").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 Point2Ds为空 的本地化字符串。
        /// </summary>
        public static string Point2DsIsNull
        {
            get
            {
                return resourceStringMap.GetValue("Point2DsIsNull").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 请确认Web服务器根目录下存在跨域策略文件,服务地址等参数是否正确。 的本地化字符串。
        /// </summary>
        public static string PolicyFileAvailable
        {
            get
            {
                return resourceStringMap.GetValue("PolicyFileAvailable").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 半径范围小于1 的本地化字符串。
        /// </summary>
        public static string RadiusLessThanOne
        {
            get
            {
                return resourceStringMap.GetValue("RadiusLessThanOne").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 right必须大于left 的本地化字符串。
        /// </summary>
        public static string RightLessThanLeft
        {
            get
            {
                return resourceStringMap.GetValue("RightLessThanLeft").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 RootElement为空 的本地化字符串。
        /// </summary>
        public static string RootElementIsNull
        {
            get
            {
                return resourceStringMap.GetValue("RootElementIsNull").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 必须以HTTP(S)模式启动应用程序,请确认把您的网站设为启动项目。 的本地化字符串。
        /// </summary>
        public static string SchemeError
        {
            get
            {
                return resourceStringMap.GetValue("SchemeError").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 服务地址错误 的本地化字符串。
        /// </summary>
        public static string ServiceAddressError
        {
            get
            {
                return resourceStringMap.GetValue("ServiceAddressError").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 请确认您的地图服务已经启动,地图名称等参数是否正确。 的本地化字符串。
        /// </summary>
        public static string ServiceStarted
        {
            get
            {
                return resourceStringMap.GetValue("ServiceStarted").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 坐标解析失败 的本地化字符串。
        /// </summary>
        public static string TextParseFailed
        {
            get
            {
                return resourceStringMap.GetValue("TextParseFailed").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 top必须大于bottom. 的本地化字符串。
        /// </summary>
        public static string TopLessThanBottom
        {
            get
            {
                return resourceStringMap.GetValue("TopLessThanBottom").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 宽度小于0 的本地化字符串。
        /// </summary>
        public static string WidthLessThanZero
        {
            get
            {
                return resourceStringMap.GetValue("WidthLessThanZero").ValueAsString;
            }
        }

        /// <summary>
        ///   查找类似 数量小于1 的本地化字符串。
        /// </summary>
        public static string CountLessThanOne
        {
            get
            {
                return resourceStringMap.GetValue("CountLessThanOne").ValueAsString;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: List of All Members for QHBoxLayout</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

List of All Members for QHBoxLayout

This is the complete list of members for QHBoxLayout, including inherited members.

enum Direction

enum SizeConstraint

QHBoxLayout ()

QHBoxLayout ( QWidget * )

~QHBoxLayout ()

activate () : bool

addChildLayout ( QLayout * )

addChildWidget ( QWidget * )

addItem ( QLayoutItem * )

addLayout ( QLayout *, int )

addSpacing ( int )

addStretch ( int )

addStrut ( int )

addWidget ( QWidget *, int, Qt::Alignment )

alignment () const : Qt::Alignment

alignmentRect ( const QRect & ) const : QRect

blockSignals ( bool ) : bool

childEvent ( QChildEvent * )

children () const : const QObjectList &

closestAcceptableSize ( const QWidget *, const QSize & ) : QSize

connect ( const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType ) : bool

connect ( const QObject *, const char *, const char *, Qt::ConnectionType ) const : bool

connectNotify ( const char * )

contentsRect () const : QRect

controlTypes () const : QSizePolicy::ControlTypes

count () const : int

customEvent ( QEvent * )

deleteLater ()

destroyed ( QObject * )

direction () const : Direction

disconnect ( const QObject *, const char *, const QObject *, const char * ) : bool

disconnect ( const char *, const QObject *, const char * ) : bool

disconnect ( const QObject *, const char * ) : bool

disconnectNotify ( const char * )

dumpObjectInfo ()

dumpObjectTree ()

dynamicPropertyNames () const : QList<QByteArray>

event ( QEvent * ) : bool

eventFilter ( QObject *, QEvent * ) : bool

expandingDirections () const : Qt::Orientations

findChild ( const QString & ) const : T

findChildren ( const QString & ) const : QList<T>

findChildren ( const QRegExp & ) const : QList<T>

geometry () const : QRect

getContentsMargins ( int *, int *, int *, int * ) const

hasHeightForWidth () const : bool

heightForWidth ( int ) const : int

indexOf ( QWidget * ) const : int

inherits ( const char * ) const : bool

insertItem ( int, QLayoutItem * )

insertLayout ( int, QLayout *, int )

insertSpacing ( int, int )

insertStretch ( int, int )

insertWidget ( int, QWidget *, int, Qt::Alignment )

installEventFilter ( QObject * )

invalidate ()

isEmpty () const : bool

isEnabled () const : bool

isWidgetType () const : bool

itemAt ( int ) const : QLayoutItem *

killTimer ( int )

layout () : QLayout *

maximumSize () const : QSize

menuBar () const : QWidget *

metaObject () const : const QMetaObject *

minimumHeightForWidth ( int ) const : int

minimumSize () const : QSize

moveToThread ( QThread * )

objectName () const : QString

parent () const : QObject *

parentWidget () const : QWidget *

property ( const char * ) const : QVariant

receivers ( const char * ) const : int

removeEventFilter ( QObject * )

removeItem ( QLayoutItem * )

removeWidget ( QWidget * )

sender () const : QObject *

setAlignment ( QWidget *, Qt::Alignment ) : bool

setAlignment ( Qt::Alignment )

setAlignment ( QLayout *, Qt::Alignment ) : bool

setContentsMargins ( int, int, int, int )

setDirection ( Direction )

setEnabled ( bool )

setGeometry ( const QRect & )

setMenuBar ( QWidget * )

setObjectName ( const QString & )

setParent ( QObject * )

setProperty ( const char *, const QVariant & ) : bool

setSizeConstraint ( SizeConstraint )

setSpacing ( int )

setStretchFactor ( QWidget *, int ) : bool

setStretchFactor ( QLayout *, int ) : bool

signalsBlocked () const : bool

sizeConstraint () const : SizeConstraint

sizeHint () const : QSize

spacerItem () : QSpacerItem *

spacing () const : int

startTimer ( int ) : int

staticMetaObject : const QMetaObject

takeAt ( int ) : QLayoutItem *

thread () const : QThread *

timerEvent ( QTimerEvent * )

tr ( const char *, const char *, int ) : QString

trUtf8 ( const char *, const char *, int ) : QString

update ()

widget () : QWidget *

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
	#pragma strict
	/// This script moves the character controller forward
	/// and sideways based on the arrow keys.
	/// It also jumps when pressing space.
	/// Make sure to attach a character controller to the same game object.
	/// It is recommended that you make only one call to Move or SimpleMove per frame.

	var facingLeft = true;
	var agachado = false;
	public var player1 : GameObject;

	// Speed in units per sec.
	var speed: float;
	var x2: float;

	function Start() {
		x2 = transform.position.x;

	}

	function Update() {
		// The step size is equal to speed times frame time.
		var step = speed * Time.deltaTime;

		// Move our position a step closer to the target.
		transform.position = Vector3.MoveTowards(transform.position, player1.transform.position, step);
		/*GIRA EL SPRITE*/
		var x1 : float = transform.position.x;
		if(x2>x1)
		{
				transform.localScale.x = 1;
				x2 = transform.position.x;
		}else{
				transform.localScale.x = -1;
				x2 = transform.position.x;
		}
		/*FIN GIRO SPRITE*/

		/*INPUT AGACHA AL PERSONAJE*/
		/*if(Input.GetKey(KeyCode.C))
		{
			agachado = true;
			Debug.Log("esta agachado: "+agachado.ToString());

		}else if(agachado)
		{
			agachado=false;
		}*/
		//else agachado = true;

		//AGACHA EL GAMEOBJECT
		/*if(agachado)
		{
			if(transform.localScale.y==1)transform.localPosition.y-=1;
			transform.localScale.y *= 0.5;
		}else
		{
			if(transform.localScale.y<1)transform.localPosition.y+=2;
			transform.localScale.y=1;
		}*/
		/*FIN AGACHAR PERSONAJE*/

	}


text:
//===-- X86AsmBackend.cpp - X86 Assembler Backend -------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86FixupKinds.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"

using namespace llvm;

namespace {
/// A wrapper for holding a mask of the values from X86::AlignBranchBoundaryKind
class X86AlignBranchKind {
private:
  uint8_t AlignBranchKind = 0;

public:
  void operator=(const std::string &Val) {
    if (Val.empty())
      return;
    SmallVector<StringRef, 6> BranchTypes;
    StringRef(Val).split(BranchTypes, '+', -1, false);
    for (auto BranchType : BranchTypes) {
      if (BranchType == "fused")
        addKind(X86::AlignBranchFused);
      else if (BranchType == "jcc")
        addKind(X86::AlignBranchJcc);
      else if (BranchType == "jmp")
        addKind(X86::AlignBranchJmp);
      else if (BranchType == "call")
        addKind(X86::AlignBranchCall);
      else if (BranchType == "ret")
        addKind(X86::AlignBranchRet);
      else if (BranchType == "indirect")
        addKind(X86::AlignBranchIndirect);
      else {
        report_fatal_error(
            "'-x86-align-branch 'The branches's type is combination of jcc, "
            "fused, jmp, call, ret, indirect.(plus separated)",
            false);
      }
    }
  }

  operator uint8_t() const { return AlignBranchKind; }
  void addKind(X86::AlignBranchBoundaryKind Value) { AlignBranchKind |= Value; }
};

X86AlignBranchKind X86AlignBranchKindLoc;

cl::opt<unsigned> X86AlignBranchBoundary(
    "x86-align-branch-boundary", cl::init(0),
    cl::desc(
        "Control how the assembler should align branches with NOP. If the "
        "boundary's size is not 0, it should be a power of 2 and no less "
        "than 32. Branches will be aligned to prevent from being across or "
        "against the boundary of specified size. The default value 0 does not "
        "align branches."));

cl::opt<X86AlignBranchKind, true, cl::parser<std::string>> X86AlignBranch(
    "x86-align-branch",
    cl::desc(
        "Specify types of branches to align. The branches's types are "
        "combination of jcc, fused, jmp, call, ret, indirect. jcc indicates "
        "conditional jumps, fused indicates fused conditional jumps, jmp "
        "indicates unconditional jumps, call indicates direct and indirect "
        "calls, ret indicates rets, indirect indicates indirect jumps."),
    cl::value_desc("(plus separated list of types)"),
    cl::location(X86AlignBranchKindLoc));

cl::opt<bool> X86AlignBranchWithin32BBoundaries(
    "x86-branches-within-32B-boundaries", cl::init(false),
    cl::desc(
        "Align selected instructions to mitigate negative performance impact "
        "of Intel's micro code update for errata skx102.  May break "
        "assumptions about labels corresponding to particular instructions, "
        "and should be used with caution."));

class X86ELFObjectWriter : public MCELFObjectTargetWriter {
public:
  X86ELFObjectWriter(bool is64Bit, uint8_t OSABI, uint16_t EMachine,
                     bool HasRelocationAddend, bool foobar)
    : MCELFObjectTargetWriter(is64Bit, OSABI, EMachine, HasRelocationAddend) {}
};

class X86AsmBackend : public MCAsmBackend {
  const MCSubtargetInfo &STI;
  std::unique_ptr<const MCInstrInfo> MCII;
  X86AlignBranchKind AlignBranchType;
  Align AlignBoundary;

  bool isMacroFused(const MCInst &Cmp, const MCInst &Jcc) const;

  bool needAlign(MCObjectStreamer &OS) const;
  bool needAlignInst(const MCInst &Inst) const;
  MCBoundaryAlignFragment *
  getOrCreateBoundaryAlignFragment(MCObjectStreamer &OS) const;
  MCInst PrevInst;

public:
  X86AsmBackend(const Target &T, const MCSubtargetInfo &STI)
      : MCAsmBackend(support::little), STI(STI),
        MCII(T.createMCInstrInfo()) {
    if (X86AlignBranchWithin32BBoundaries) {
      // At the moment, this defaults to aligning fused branches, unconditional
      // jumps, and (unfused) conditional jumps with nops.  Both the
      // instructions aligned and the alignment method (nop vs prefix) may
      // change in the future.
      AlignBoundary = assumeAligned(32);;
      AlignBranchType.addKind(X86::AlignBranchFused);
      AlignBranchType.addKind(X86::AlignBranchJcc);
      AlignBranchType.addKind(X86::AlignBranchJmp);
    }
    // Allow overriding defaults set by master flag
    if (X86AlignBranchBoundary.getNumOccurrences())
      AlignBoundary = assumeAligned(X86AlignBranchBoundary);
    if (X86AlignBranch.getNumOccurrences())
      AlignBranchType = X86AlignBranchKindLoc;
  }

  bool allowAutoPadding() const override;
  void alignBranchesBegin(MCObjectStreamer &OS, const MCInst &Inst) override;
  void alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst) override;

  unsigned getNumFixupKinds() const override {
    return X86::NumTargetFixupKinds;
  }

  Optional<MCFixupKind> getFixupKind(StringRef Name) const override;

  const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;

  bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup,
                             const MCValue &Target) override;

  void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
                  const MCValue &Target, MutableArrayRef<char> Data,
                  uint64_t Value, bool IsResolved,
                  const MCSubtargetInfo *STI) const override;

  bool mayNeedRelaxation(const MCInst &Inst,
                         const MCSubtargetInfo &STI) const override;

  bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
                            const MCRelaxableFragment *DF,
                            const MCAsmLayout &Layout) const override;

  void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
                        MCInst &Res) const override;

  bool writeNopData(raw_ostream &OS, uint64_t Count) const override;
};
} // end anonymous namespace

static unsigned getRelaxedOpcodeBranch(const MCInst &Inst, bool is16BitMode) {
  unsigned Op = Inst.getOpcode();
  switch (Op) {
  default:
    return Op;
  case X86::JCC_1:
    return (is16BitMode) ? X86::JCC_2 : X86::JCC_4;
  case X86::JMP_1:
    return (is16BitMode) ? X86::JMP_2 : X86::JMP_4;
  }
}

static unsigned getRelaxedOpcodeArith(const MCInst &Inst) {
  unsigned Op = Inst.getOpcode();
  switch (Op) {
  default:
    return Op;

    // IMUL
  case X86::IMUL16rri8: return X86::IMUL16rri;
  case X86::IMUL16rmi8: return X86::IMUL16rmi;
  case X86::IMUL32rri8: return X86::IMUL32rri;
  case X86::IMUL32rmi8: return X86::IMUL32rmi;
  case X86::IMUL64rri8: return X86::IMUL64rri32;
  case X86::IMUL64rmi8: return X86::IMUL64rmi32;

    // AND
  case X86::AND16ri8: return X86::AND16ri;
  case X86::AND16mi8: return X86::AND16mi;
  case X86::AND32ri8: return X86::AND32ri;
  case X86::AND32mi8: return X86::AND32mi;
  case X86::AND64ri8: return X86::AND64ri32;
  case X86::AND64mi8: return X86::AND64mi32;

    // OR
  case X86::OR16ri8: return X86::OR16ri;
  case X86::OR16mi8: return X86::OR16mi;
  case X86::OR32ri8: return X86::OR32ri;
  case X86::OR32mi8: return X86::OR32mi;
  case X86::OR64ri8: return X86::OR64ri32;
  case X86::OR64mi8: return X86::OR64mi32;

    // XOR
  case X86::XOR16ri8: return X86::XOR16ri;
  case X86::XOR16mi8: return X86::XOR16mi;
  case X86::XOR32ri8: return X86::XOR32ri;
  case X86::XOR32mi8: return X86::XOR32mi;
  case X86::XOR64ri8: return X86::XOR64ri32;
  case X86::XOR64mi8: return X86::XOR64mi32;

    // ADD
  case X86::ADD16ri8: return X86::ADD16ri;
  case X86::ADD16mi8: return X86::ADD16mi;
  case X86::ADD32ri8: return X86::ADD32ri;
  case X86::ADD32mi8: return X86::ADD32mi;
  case X86::ADD64ri8: return X86::ADD64ri32;
  case X86::ADD64mi8: return X86::ADD64mi32;

   // ADC
  case X86::ADC16ri8: return X86::ADC16ri;
  case X86::ADC16mi8: return X86::ADC16mi;
  case X86::ADC32ri8: return X86::ADC32ri;
  case X86::ADC32mi8: return X86::ADC32mi;
  case X86::ADC64ri8: return X86::ADC64ri32;
  case X86::ADC64mi8: return X86::ADC64mi32;

    // SUB
  case X86::SUB16ri8: return X86::SUB16ri;
  case X86::SUB16mi8: return X86::SUB16mi;
  case X86::SUB32ri8: return X86::SUB32ri;
  case X86::SUB32mi8: return X86::SUB32mi;
  case X86::SUB64ri8: return X86::SUB64ri32;
  case X86::SUB64mi8: return X86::SUB64mi32;

   // SBB
  case X86::SBB16ri8: return X86::SBB16ri;
  case X86::SBB16mi8: return X86::SBB16mi;
  case X86::SBB32ri8: return X86::SBB32ri;
  case X86::SBB32mi8: return X86::SBB32mi;
  case X86::SBB64ri8: return X86::SBB64ri32;
  case X86::SBB64mi8: return X86::SBB64mi32;

    // CMP
  case X86::CMP16ri8: return X86::CMP16ri;
  case X86::CMP16mi8: return X86::CMP16mi;
  case X86::CMP32ri8: return X86::CMP32ri;
  case X86::CMP32mi8: return X86::CMP32mi;
  case X86::CMP64ri8: return X86::CMP64ri32;
  case X86::CMP64mi8: return X86::CMP64mi32;

    // PUSH
  case X86::PUSH32i8:  return X86::PUSHi32;
  case X86::PUSH16i8:  return X86::PUSHi16;
  case X86::PUSH64i8:  return X86::PUSH64i32;
  }
}

static unsigned getRelaxedOpcode(const MCInst &Inst, bool is16BitMode) {
  unsigned R = getRelaxedOpcodeArith(Inst);
  if (R != Inst.getOpcode())
    return R;
  return getRelaxedOpcodeBranch(Inst, is16BitMode);
}

static X86::CondCode getCondFromBranch(const MCInst &MI,
                                       const MCInstrInfo &MCII) {
  unsigned Opcode = MI.getOpcode();
  switch (Opcode) {
  default:
    return X86::COND_INVALID;
  case X86::JCC_1: {
    const MCInstrDesc &Desc = MCII.get(Opcode);
    return static_cast<X86::CondCode>(
        MI.getOperand(Desc.getNumOperands() - 1).getImm());
  }
  }
}

static X86::SecondMacroFusionInstKind
classifySecondInstInMacroFusion(const MCInst &MI, const MCInstrInfo &MCII) {
  X86::CondCode CC = getCondFromBranch(MI, MCII);
  return classifySecondCondCodeInMacroFusion(CC);
}

/// Check if the instruction uses RIP relative addressing.
static bool isRIPRelative(const MCInst &MI, const MCInstrInfo &MCII) {
  unsigned Opcode = MI.getOpcode();
  const MCInstrDesc &Desc = MCII.get(Opcode);
  uint64_t TSFlags = Desc.TSFlags;
  unsigned CurOp = X86II::getOperandBias(Desc);
  int MemoryOperand = X86II::getMemoryOperandNo(TSFlags);
  if (MemoryOperand < 0)
    return false;
  unsigned BaseRegNum = MemoryOperand + CurOp + X86::AddrBaseReg;
  unsigned BaseReg = MI.getOperand(BaseRegNum).getReg();
  return (BaseReg == X86::RIP);
}

/// Check if the instruction is valid as the first instruction in macro fusion.
static bool isFirstMacroFusibleInst(const MCInst &Inst,
                                    const MCInstrInfo &MCII) {
  // An Intel instruction with RIP relative addressing is not macro fusible.
  if (isRIPRelative(Inst, MCII))
    return false;
  X86::FirstMacroFusionInstKind FIK =
      X86::classifyFirstOpcodeInMacroFusion(Inst.getOpcode());
  return FIK != X86::FirstMacroFusionInstKind::Invalid;
}

/// Check if the two instructions will be macro-fused on the target cpu.
bool X86AsmBackend::isMacroFused(const MCInst &Cmp, const MCInst &Jcc) const {
  const MCInstrDesc &InstDesc = MCII->get(Jcc.getOpcode());
  if (!InstDesc.isConditionalBranch())
    return false;
  if (!isFirstMacroFusibleInst(Cmp, *MCII))
    return false;
  const X86::FirstMacroFusionInstKind CmpKind =
      X86::classifyFirstOpcodeInMacroFusion(Cmp.getOpcode());
  const X86::SecondMacroFusionInstKind BranchKind =
      classifySecondInstInMacroFusion(Jcc, *MCII);
  return X86::isMacroFused(CmpKind, BranchKind);
}

/// Check if the instruction has a variant symbol operand.
static bool hasVariantSymbol(const MCInst &MI) {
  for (auto &Operand : MI) {
    if (!Operand.isExpr())
      continue;
    const MCExpr &Expr = *Operand.getExpr();
    if (Expr.getKind() == MCExpr::SymbolRef &&
        cast<MCSymbolRefExpr>(Expr).getKind() != MCSymbolRefExpr::VK_None)
      return true;
  }
  return false;
}

bool X86AsmBackend::allowAutoPadding() const {
  return (AlignBoundary != Align::None() &&
          AlignBranchType != X86::AlignBranchNone);
}

bool X86AsmBackend::needAlign(MCObjectStreamer &OS) const {
  if (!OS.getAllowAutoPadding())
    return false;
  assert(allowAutoPadding() && "incorrect initialization!");

  MCAssembler &Assembler = OS.getAssembler();
  MCSection *Sec = OS.getCurrentSectionOnly();
  // To be Done: Currently don't deal with Bundle cases.
  if (Assembler.isBundlingEnabled() && Sec->isBundleLocked())
    return false;

  // Branches only need to be aligned in 32-bit or 64-bit mode.
  if (!(STI.hasFeature(X86::Mode64Bit) || STI.hasFeature(X86::Mode32Bit)))
    return false;

  return true;
}

/// Check if the instruction operand needs to be aligned. Padding is disabled
/// before intruction which may be rewritten by linker(e.g. TLSCALL).
bool X86AsmBackend::needAlignInst(const MCInst &Inst) const {
  // Linker may rewrite the instruction with variant symbol operand.
  if (hasVariantSymbol(Inst))
    return false;

  const MCInstrDesc &InstDesc = MCII->get(Inst.getOpcode());
  return (InstDesc.isConditionalBranch() &&
          (AlignBranchType & X86::AlignBranchJcc)) ||
         (InstDesc.isUnconditionalBranch() &&
          (AlignBranchType & X86::AlignBranchJmp)) ||
         (InstDesc.isCall() &&
          (AlignBranchType & X86::AlignBranchCall)) ||
         (InstDesc.isReturn() &&
          (AlignBranchType & X86::AlignBranchRet)) ||
         (InstDesc.isIndirectBranch() &&
          (AlignBranchType & X86::AlignBranchIndirect));
}

static bool canReuseBoundaryAlignFragment(const MCBoundaryAlignFragment &F) {
  // If a MCBoundaryAlignFragment has not been used to emit NOP,we can reuse it.
  return !F.canEmitNops();
}

MCBoundaryAlignFragment *
X86AsmBackend::getOrCreateBoundaryAlignFragment(MCObjectStreamer &OS) const {
  auto *F = dyn_cast_or_null<MCBoundaryAlignFragment>(OS.getCurrentFragment());
  if (!F || !canReuseBoundaryAlignFragment(*F)) {
    F = new MCBoundaryAlignFragment(AlignBoundary);
    OS.insert(F);
  }
  return F;
}

/// Insert MCBoundaryAlignFragment before instructions to align branches.
void X86AsmBackend::alignBranchesBegin(MCObjectStreamer &OS,
                                       const MCInst &Inst) {
  if (!needAlign(OS))
    return;

  MCFragment *CF = OS.getCurrentFragment();
  bool NeedAlignFused = AlignBranchType & X86::AlignBranchFused;
  if (NeedAlignFused && isMacroFused(PrevInst, Inst) && CF) {
    // Macro fusion actually happens and there is no other fragment inserted
    // after the previous instruction. NOP can be emitted in PF to align fused
    // jcc.
    if (auto *PF =
            dyn_cast_or_null<MCBoundaryAlignFragment>(CF->getPrevNode())) {
      const_cast<MCBoundaryAlignFragment *>(PF)->setEmitNops(true);
      const_cast<MCBoundaryAlignFragment *>(PF)->setFused(true);
    }
  } else if (needAlignInst(Inst)) {
    // Note: When there is at least one fragment, such as MCAlignFragment,
    // inserted after the previous instruction, e.g.
    //
    // \code
    //   cmp %rax %rcx
    //   .align 16
    //   je .Label0
    // \ endcode
    //
    // We will treat the JCC as a unfused branch although it may be fused
    // with the CMP.
    auto *F = getOrCreateBoundaryAlignFragment(OS);
    F->setEmitNops(true);
    F->setFused(false);
  } else if (NeedAlignFused && isFirstMacroFusibleInst(Inst, *MCII)) {
    // We don't know if macro fusion happens until the reaching the next
    // instruction, so a place holder is put here if necessary.
    getOrCreateBoundaryAlignFragment(OS);
  }

  PrevInst = Inst;
}

/// Insert a MCBoundaryAlignFragment to mark the end of the branch to be aligned
/// if necessary.
void X86AsmBackend::alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst) {
  if (!needAlign(OS))
    return;
  // If the branch is emitted into a MCRelaxableFragment, we can determine the
  // size of the branch easily in MCAssembler::relaxBoundaryAlign. When the
  // branch is fused, the fused branch(macro fusion pair) must be emitted into
  // two fragments. Or when the branch is unfused, the branch must be emitted
  // into one fragment. The MCRelaxableFragment naturally marks the end of the
  // fused or unfused branch.
  // Otherwise, we need to insert a MCBoundaryAlignFragment to mark the end of
  // the branch. This MCBoundaryAlignFragment may be reused to emit NOP to align
  // other branch.
  if (needAlignInst(Inst) && !isa<MCRelaxableFragment>(OS.getCurrentFragment()))
    OS.insert(new MCBoundaryAlignFragment(AlignBoundary));

  // Update the maximum alignment on the current section if necessary.
  MCSection *Sec = OS.getCurrentSectionOnly();
  if (AlignBoundary.value() > Sec->getAlignment())
    Sec->setAlignment(AlignBoundary);
}

Optional<MCFixupKind> X86AsmBackend::getFixupKind(StringRef Name) const {
  if (STI.getTargetTriple().isOSBinFormatELF()) {
    if (STI.getTargetTriple().getArch() == Triple::x86_64) {
      if (Name == "R_X86_64_NONE")
        return FK_NONE;
    } else {
      if (Name == "R_386_NONE")
        return FK_NONE;
    }
  }
  return MCAsmBackend::getFixupKind(Name);
}

const MCFixupKindInfo &X86AsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
  const static MCFixupKindInfo Infos[X86::NumTargetFixupKinds] = {
      {"reloc_riprel_4byte", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
      {"reloc_riprel_4byte_movq_load", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
      {"reloc_riprel_4byte_relax", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
      {"reloc_riprel_4byte_relax_rex", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
      {"reloc_signed_4byte", 0, 32, 0},
      {"reloc_signed_4byte_relax", 0, 32, 0},
      {"reloc_global_offset_table", 0, 32, 0},
      {"reloc_global_offset_table8", 0, 64, 0},
      {"reloc_branch_4byte_pcrel", 0, 32, MCFixupKindInfo::FKF_IsPCRel},
  };

  if (Kind < FirstTargetFixupKind)
    return MCAsmBackend::getFixupKindInfo(Kind);

  assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() &&
         "Invalid kind!");
  assert(Infos[Kind - FirstTargetFixupKind].Name && "Empty fixup name!");
  return Infos[Kind - FirstTargetFixupKind];
}

bool X86AsmBackend::shouldForceRelocation(const MCAssembler &,
                                          const MCFixup &Fixup,
                                          const MCValue &) {
  return Fixup.getKind() == FK_NONE;
}

static unsigned getFixupKindSize(unsigned Kind) {
  switch (Kind) {
  default:
    llvm_unreachable("invalid fixup kind!");
  case FK_NONE:
    return 0;
  case FK_PCRel_1:
  case FK_SecRel_1:
  case FK_Data_1:
    return 1;
  case FK_PCRel_2:
  case FK_SecRel_2:
  case FK_Data_2:
    return 2;
  case FK_PCRel_4:
  case X86::reloc_riprel_4byte:
  case X86::reloc_riprel_4byte_relax:
  case X86::reloc_riprel_4byte_relax_rex:
  case X86::reloc_riprel_4byte_movq_load:
  case X86::reloc_signed_4byte:
  case X86::reloc_signed_4byte_relax:
  case X86::reloc_global_offset_table:
  case X86::reloc_branch_4byte_pcrel:
  case FK_SecRel_4:
  case FK_Data_4:
    return 4;
  case FK_PCRel_8:
  case FK_SecRel_8:
  case FK_Data_8:
  case X86::reloc_global_offset_table8:
    return 8;
  }
}

void X86AsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
                               const MCValue &Target,
                               MutableArrayRef<char> Data,
                               uint64_t Value, bool IsResolved,
                               const MCSubtargetInfo *STI) const {
  unsigned Size = getFixupKindSize(Fixup.getKind());

  assert(Fixup.getOffset() + Size <= Data.size() && "Invalid fixup offset!");

  int64_t SignedValue = static_cast<int64_t>(Value);
  if ((Target.isAbsolute() || IsResolved) &&
      getFixupKindInfo(Fixup.getKind()).Flags &
      MCFixupKindInfo::FKF_IsPCRel) {
    // check that PC relative fixup fits into the fixup size.
    if (Size > 0 && !isIntN(Size * 8, SignedValue))
      Asm.getContext().reportError(
                                   Fixup.getLoc(), "value of " + Twine(SignedValue) +
                                   " is too large for field of " + Twine(Size) +
                                   ((Size == 1) ? " byte." : " bytes."));
  } else {
    // Check that uppper bits are either all zeros or all ones.
    // Specifically ignore overflow/underflow as long as the leakage is
    // limited to the lower bits. This is to remain compatible with
    // other assemblers.
    assert((Size == 0 || isIntN(Size * 8 + 1, SignedValue)) &&
           "Value does not fit in the Fixup field");
  }

  for (unsigned i = 0; i != Size; ++i)
    Data[Fixup.getOffset() + i] = uint8_t(Value >> (i * 8));
}

bool X86AsmBackend::mayNeedRelaxation(const MCInst &Inst,
                                      const MCSubtargetInfo &STI) const {
  // Branches can always be relaxed in either mode.
  if (getRelaxedOpcodeBranch(Inst, false) != Inst.getOpcode())
    return true;

  // Check if this instruction is ever relaxable.
  if (getRelaxedOpcodeArith(Inst) == Inst.getOpcode())
    return false;

  // Check if the relaxable operand has an expression. For the current set of
  // relaxable instructions, the relaxable operand is always the last operand.
  unsigned RelaxableOp = Inst.getNumOperands() - 1;
  if (Inst.getOperand(RelaxableOp).isExpr())
    return true;

  return false;
}

bool X86AsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
                                         uint64_t Value,
                                         const MCRelaxableFragment *DF,
                                         const MCAsmLayout &Layout) const {
  // Relax if the value is too big for a (signed) i8.
  return !isInt<8>(Value);
}

// FIXME: Can tblgen help at all here to verify there aren't other instructions
// we can relax?
void X86AsmBackend::relaxInstruction(const MCInst &Inst,
                                     const MCSubtargetInfo &STI,
                                     MCInst &Res) const {
  // The only relaxations X86 does is from a 1byte pcrel to a 4byte pcrel.
  bool is16BitMode = STI.getFeatureBits()[X86::Mode16Bit];
  unsigned RelaxedOp = getRelaxedOpcode(Inst, is16BitMode);

  if (RelaxedOp == Inst.getOpcode()) {
    SmallString<256> Tmp;
    raw_svector_ostream OS(Tmp);
    Inst.dump_pretty(OS);
    OS << "\n";
    report_fatal_error("unexpected instruction to relax: " + OS.str());
  }

  Res = Inst;
  Res.setOpcode(RelaxedOp);
}

/// Write a sequence of optimal nops to the output, covering \p Count
/// bytes.
/// \return - true on success, false on failure
bool X86AsmBackend::writeNopData(raw_ostream &OS, uint64_t Count) const {
  static const char Nops[10][11] = {
    // nop
    "\x90",
    // xchg %ax,%ax
    "\x66\x90",
    // nopl (%[re]ax)
    "\x0f\x1f\x00",
    // nopl 0(%[re]ax)
    "\x0f\x1f\x40\x00",
    // nopl 0(%[re]ax,%[re]ax,1)
    "\x0f\x1f\x44\x00\x00",
    // nopw 0(%[re]ax,%[re]ax,1)
    "\x66\x0f\x1f\x44\x00\x00",
    // nopl 0L(%[re]ax)
    "\x0f\x1f\x80\x00\x00\x00\x00",
    // nopl 0L(%[re]ax,%[re]ax,1)
    "\x0f\x1f\x84\x00\x00\x00\x00\x00",
    // nopw 0L(%[re]ax,%[re]ax,1)
    "\x66\x0f\x1f\x84\x00\x00\x00\x00\x00",
    // nopw %cs:0L(%[re]ax,%[re]ax,1)
    "\x66\x2e\x0f\x1f\x84\x00\x00\x00\x00\x00",
  };

  // This CPU doesn't support long nops. If needed add more.
  // FIXME: We could generated something better than plain 0x90.
  if (!STI.getFeatureBits()[X86::FeatureNOPL]) {
    for (uint64_t i = 0; i < Count; ++i)
      OS << '\x90';
    return true;
  }

  // 15-bytes is the longest single NOP instruction, but 10-bytes is
  // commonly the longest that can be efficiently decoded.
  uint64_t MaxNopLength = 10;
  if (STI.getFeatureBits()[X86::ProcIntelSLM])
    MaxNopLength = 7;
  else if (STI.getFeatureBits()[X86::FeatureFast15ByteNOP])
    MaxNopLength = 15;
  else if (STI.getFeatureBits()[X86::FeatureFast11ByteNOP])
    MaxNopLength = 11;

  // Emit as many MaxNopLength NOPs as needed, then emit a NOP of the remaining
  // length.
  do {
    const uint8_t ThisNopLength = (uint8_t) std::min(Count, MaxNopLength);
    const uint8_t Prefixes = ThisNopLength <= 10 ? 0 : ThisNopLength - 10;
    for (uint8_t i = 0; i < Prefixes; i++)
      OS << '\x66';
    const uint8_t Rest = ThisNopLength - Prefixes;
    if (Rest != 0)
      OS.write(Nops[Rest - 1], Rest);
    Count -= ThisNopLength;
  } while (Count != 0);

  return true;
}

/* *** */

namespace {

class ELFX86AsmBackend : public X86AsmBackend {
public:
  uint8_t OSABI;
  ELFX86AsmBackend(const Target &T, uint8_t OSABI, const MCSubtargetInfo &STI)
      : X86AsmBackend(T, STI), OSABI(OSABI) {}
};

class ELFX86_32AsmBackend : public ELFX86AsmBackend {
public:
  ELFX86_32AsmBackend(const Target &T, uint8_t OSABI,
                      const MCSubtargetInfo &STI)
    : ELFX86AsmBackend(T, OSABI, STI) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86ELFObjectWriter(/*IsELF64*/ false, OSABI, ELF::EM_386);
  }
};

class ELFX86_X32AsmBackend : public ELFX86AsmBackend {
public:
  ELFX86_X32AsmBackend(const Target &T, uint8_t OSABI,
                       const MCSubtargetInfo &STI)
      : ELFX86AsmBackend(T, OSABI, STI) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86ELFObjectWriter(/*IsELF64*/ false, OSABI,
                                    ELF::EM_X86_64);
  }
};

class ELFX86_IAMCUAsmBackend : public ELFX86AsmBackend {
public:
  ELFX86_IAMCUAsmBackend(const Target &T, uint8_t OSABI,
                         const MCSubtargetInfo &STI)
      : ELFX86AsmBackend(T, OSABI, STI) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86ELFObjectWriter(/*IsELF64*/ false, OSABI,
                                    ELF::EM_IAMCU);
  }
};

class ELFX86_64AsmBackend : public ELFX86AsmBackend {
public:
  ELFX86_64AsmBackend(const Target &T, uint8_t OSABI,
                      const MCSubtargetInfo &STI)
    : ELFX86AsmBackend(T, OSABI, STI) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86ELFObjectWriter(/*IsELF64*/ true, OSABI, ELF::EM_X86_64);
  }
};

class WindowsX86AsmBackend : public X86AsmBackend {
  bool Is64Bit;

public:
  WindowsX86AsmBackend(const Target &T, bool is64Bit,
                       const MCSubtargetInfo &STI)
    : X86AsmBackend(T, STI)
    , Is64Bit(is64Bit) {
  }

  Optional<MCFixupKind> getFixupKind(StringRef Name) const override {
    return StringSwitch<Optional<MCFixupKind>>(Name)
        .Case("dir32", FK_Data_4)
        .Case("secrel32", FK_SecRel_4)
        .Case("secidx", FK_SecRel_2)
        .Default(MCAsmBackend::getFixupKind(Name));
  }

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86WinCOFFObjectWriter(Is64Bit);
  }
};

namespace CU {

  /// Compact unwind encoding values.
  enum CompactUnwindEncodings {
    /// [RE]BP based frame where [RE]BP is pused on the stack immediately after
    /// the return address, then [RE]SP is moved to [RE]BP.
    UNWIND_MODE_BP_FRAME                   = 0x01000000,

    /// A frameless function with a small constant stack size.
    UNWIND_MODE_STACK_IMMD                 = 0x02000000,

    /// A frameless function with a large constant stack size.
    UNWIND_MODE_STACK_IND                  = 0x03000000,

    /// No compact unwind encoding is available.
    UNWIND_MODE_DWARF                      = 0x04000000,

    /// Mask for encoding the frame registers.
    UNWIND_BP_FRAME_REGISTERS              = 0x00007FFF,

    /// Mask for encoding the frameless registers.
    UNWIND_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF
  };

} // end CU namespace

class DarwinX86AsmBackend : public X86AsmBackend {
  const MCRegisterInfo &MRI;

  /// Number of registers that can be saved in a compact unwind encoding.
  enum { CU_NUM_SAVED_REGS = 6 };

  mutable unsigned SavedRegs[CU_NUM_SAVED_REGS];
  bool Is64Bit;

  unsigned OffsetSize;                   ///< Offset of a "push" instruction.
  unsigned MoveInstrSize;                ///< Size of a "move" instruction.
  unsigned StackDivide;                  ///< Amount to adjust stack size by.
protected:
  /// Size of a "push" instruction for the given register.
  unsigned PushInstrSize(unsigned Reg) const {
    switch (Reg) {
      case X86::EBX:
      case X86::ECX:
      case X86::EDX:
      case X86::EDI:
      case X86::ESI:
      case X86::EBP:
      case X86::RBX:
      case X86::RBP:
        return 1;
      case X86::R12:
      case X86::R13:
      case X86::R14:
      case X86::R15:
        return 2;
    }
    return 1;
  }

  /// Implementation of algorithm to generate the compact unwind encoding
  /// for the CFI instructions.
  uint32_t
  generateCompactUnwindEncodingImpl(ArrayRef<MCCFIInstruction> Instrs) const {
    if (Instrs.empty()) return 0;

    // Reset the saved registers.
    unsigned SavedRegIdx = 0;
    memset(SavedRegs, 0, sizeof(SavedRegs));

    bool HasFP = false;

    // Encode that we are using EBP/RBP as the frame pointer.
    uint32_t CompactUnwindEncoding = 0;

    unsigned SubtractInstrIdx = Is64Bit ? 3 : 2;
    unsigned InstrOffset = 0;
    unsigned StackAdjust = 0;
    unsigned StackSize = 0;
    unsigned NumDefCFAOffsets = 0;

    for (unsigned i = 0, e = Instrs.size(); i != e; ++i) {
      const MCCFIInstruction &Inst = Instrs[i];

      switch (Inst.getOperation()) {
      default:
        // Any other CFI directives indicate a frame that we aren't prepared
        // to represent via compact unwind, so just bail out.
        return 0;
      case MCCFIInstruction::OpDefCfaRegister: {
        // Defines a frame pointer. E.g.
        //
        //     movq %rsp, %rbp
        //  L0:
        //     .cfi_def_cfa_register %rbp
        //
        HasFP = true;

        // If the frame pointer is other than esp/rsp, we do not have a way to
        // generate a compact unwinding representation, so bail out.
        if (*MRI.getLLVMRegNum(Inst.getRegister(), true) !=
            (Is64Bit ? X86::RBP : X86::EBP))
          return 0;

        // Reset the counts.
        memset(SavedRegs, 0, sizeof(SavedRegs));
        StackAdjust = 0;
        SavedRegIdx = 0;
        InstrOffset += MoveInstrSize;
        break;
      }
      case MCCFIInstruction::OpDefCfaOffset: {
        // Defines a new offset for the CFA. E.g.
        //
        //  With frame:
        //
        //     pushq %rbp
        //  L0:
        //     .cfi_def_cfa_offset 16
        //
        //  Without frame:
        //
        //     subq $72, %rsp
        //  L0:
        //     .cfi_def_cfa_offset 80
        //
        StackSize = std::abs(Inst.getOffset()) / StackDivide;
        ++NumDefCFAOffsets;
        break;
      }
      case MCCFIInstruction::OpOffset: {
        // Defines a "push" of a callee-saved register. E.g.
        //
        //     pushq %r15
        //     pushq %r14
        //     pushq %rbx
        //  L0:
        //     subq $120, %rsp
        //  L1:
        //     .cfi_offset %rbx, -40
        //     .cfi_offset %r14, -32
        //     .cfi_offset %r15, -24
        //
        if (SavedRegIdx == CU_NUM_SAVED_REGS)
          // If there are too many saved registers, we cannot use a compact
          // unwind encoding.
          return CU::UNWIND_MODE_DWARF;

        unsigned Reg = *MRI.getLLVMRegNum(Inst.getRegister(), true);
        SavedRegs[SavedRegIdx++] = Reg;
        StackAdjust += OffsetSize;
        InstrOffset += PushInstrSize(Reg);
        break;
      }
      }
    }

    StackAdjust /= StackDivide;

    if (HasFP) {
      if ((StackAdjust & 0xFF) != StackAdjust)
        // Offset was too big for a compact unwind encoding.
        return CU::UNWIND_MODE_DWARF;

      // Get the encoding of the saved registers when we have a frame pointer.
      uint32_t RegEnc = encodeCompactUnwindRegistersWithFrame();
      if (RegEnc == ~0U) return CU::UNWIND_MODE_DWARF;

      CompactUnwindEncoding |= CU::UNWIND_MODE_BP_FRAME;
      CompactUnwindEncoding |= (StackAdjust & 0xFF) << 16;
      CompactUnwindEncoding |= RegEnc & CU::UNWIND_BP_FRAME_REGISTERS;
    } else {
      SubtractInstrIdx += InstrOffset;
      ++StackAdjust;

      if ((StackSize & 0xFF) == StackSize) {
        // Frameless stack with a small stack size.
        CompactUnwindEncoding |= CU::UNWIND_MODE_STACK_IMMD;

        // Encode the stack size.
        CompactUnwindEncoding |= (StackSize & 0xFF) << 16;
      } else {
        if ((StackAdjust & 0x7) != StackAdjust)
          // The extra stack adjustments are too big for us to handle.
          return CU::UNWIND_MODE_DWARF;

        // Frameless stack with an offset too large for us to encode compactly.
        CompactUnwindEncoding |= CU::UNWIND_MODE_STACK_IND;

        // Encode the offset to the nnnnnn value in the 'subl $nnnnnn, ESP'
        // instruction.
        CompactUnwindEncoding |= (SubtractInstrIdx & 0xFF) << 16;

        // Encode any extra stack adjustments (done via push instructions).
        CompactUnwindEncoding |= (StackAdjust & 0x7) << 13;
      }

      // Encode the number of registers saved. (Reverse the list first.)
      std::reverse(&SavedRegs[0], &SavedRegs[SavedRegIdx]);
      CompactUnwindEncoding |= (SavedRegIdx & 0x7) << 10;

      // Get the encoding of the saved registers when we don't have a frame
      // pointer.
      uint32_t RegEnc = encodeCompactUnwindRegistersWithoutFrame(SavedRegIdx);
      if (RegEnc == ~0U) return CU::UNWIND_MODE_DWARF;

      // Encode the register encoding.
      CompactUnwindEncoding |=
        RegEnc & CU::UNWIND_FRAMELESS_STACK_REG_PERMUTATION;
    }

    return CompactUnwindEncoding;
  }

private:
  /// Get the compact unwind number for a given register. The number
  /// corresponds to the enum lists in compact_unwind_encoding.h.
  int getCompactUnwindRegNum(unsigned Reg) const {
    static const MCPhysReg CU32BitRegs[7] = {
      X86::EBX, X86::ECX, X86::EDX, X86::EDI, X86::ESI, X86::EBP, 0
    };
    static const MCPhysReg CU64BitRegs[] = {
      X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0
    };
    const MCPhysReg *CURegs = Is64Bit ? CU64BitRegs : CU32BitRegs;
    for (int Idx = 1; *CURegs; ++CURegs, ++Idx)
      if (*CURegs == Reg)
        return Idx;

    return -1;
  }

  /// Return the registers encoded for a compact encoding with a frame
  /// pointer.
  uint32_t encodeCompactUnwindRegistersWithFrame() const {
    // Encode the registers in the order they were saved --- 3-bits per
    // register. The list of saved registers is assumed to be in reverse
    // order. The registers are numbered from 1 to CU_NUM_SAVED_REGS.
    uint32_t RegEnc = 0;
    for (int i = 0, Idx = 0; i != CU_NUM_SAVED_REGS; ++i) {
      unsigned Reg = SavedRegs[i];
      if (Reg == 0) break;

      int CURegNum = getCompactUnwindRegNum(Reg);
      if (CURegNum == -1) return ~0U;

      // Encode the 3-bit register number in order, skipping over 3-bits for
      // each register.
      RegEnc |= (CURegNum & 0x7) << (Idx++ * 3);
    }

    assert((RegEnc & 0x3FFFF) == RegEnc &&
           "Invalid compact register encoding!");
    return RegEnc;
  }

  /// Create the permutation encoding used with frameless stacks. It is
  /// passed the number of registers to be saved and an array of the registers
  /// saved.
  uint32_t encodeCompactUnwindRegistersWithoutFrame(unsigned RegCount) const {
    // The saved registers are numbered from 1 to 6. In order to encode the
    // order in which they were saved, we re-number them according to their
    // place in the register order. The re-numbering is relative to the last
    // re-numbered register. E.g., if we have registers {6, 2, 4, 5} saved in
    // that order:
    //
    //    Orig  Re-Num
    //    ----  ------
    //     6       6
    //     2       2
    //     4       3
    //     5       3
    //
    for (unsigned i = 0; i < RegCount; ++i) {
      int CUReg = getCompactUnwindRegNum(SavedRegs[i]);
      if (CUReg == -1) return ~0U;
      SavedRegs[i] = CUReg;
    }

    // Reverse the list.
    std::reverse(&SavedRegs[0], &SavedRegs[CU_NUM_SAVED_REGS]);

    uint32_t RenumRegs[CU_NUM_SAVED_REGS];
    for (unsigned i = CU_NUM_SAVED_REGS - RegCount; i < CU_NUM_SAVED_REGS; ++i){
      unsigned Countless = 0;
      for (unsigned j = CU_NUM_SAVED_REGS - RegCount; j < i; ++j)
        if (SavedRegs[j] < SavedRegs[i])
          ++Countless;

      RenumRegs[i] = SavedRegs[i] - Countless - 1;
    }

    // Take the renumbered values and encode them into a 10-bit number.
    uint32_t permutationEncoding = 0;
    switch (RegCount) {
    case 6:
      permutationEncoding |= 120 * RenumRegs[0] + 24 * RenumRegs[1]
                             + 6 * RenumRegs[2] +  2 * RenumRegs[3]
                             +     RenumRegs[4];
      break;
    case 5:
      permutationEncoding |= 120 * RenumRegs[1] + 24 * RenumRegs[2]
                             + 6 * RenumRegs[3] +  2 * RenumRegs[4]
                             +     RenumRegs[5];
      break;
    case 4:
      permutationEncoding |=  60 * RenumRegs[2] + 12 * RenumRegs[3]
                             + 3 * RenumRegs[4] +      RenumRegs[5];
      break;
    case 3:
      permutationEncoding |=  20 * RenumRegs[3] +  4 * RenumRegs[4]
                             +     RenumRegs[5];
      break;
    case 2:
      permutationEncoding |=   5 * RenumRegs[4] +      RenumRegs[5];
      break;
    case 1:
      permutationEncoding |=       RenumRegs[5];
      break;
    }

    assert((permutationEncoding & 0x3FF) == permutationEncoding &&
           "Invalid compact register encoding!");
    return permutationEncoding;
  }

public:
  DarwinX86AsmBackend(const Target &T, const MCRegisterInfo &MRI,
                      const MCSubtargetInfo &STI, bool Is64Bit)
    : X86AsmBackend(T, STI), MRI(MRI), Is64Bit(Is64Bit) {
    memset(SavedRegs, 0, sizeof(SavedRegs));
    OffsetSize = Is64Bit ? 8 : 4;
    MoveInstrSize = Is64Bit ? 3 : 2;
    StackDivide = Is64Bit ? 8 : 4;
  }
};

class DarwinX86_32AsmBackend : public DarwinX86AsmBackend {
public:
  DarwinX86_32AsmBackend(const Target &T, const MCRegisterInfo &MRI,
                         const MCSubtargetInfo &STI)
      : DarwinX86AsmBackend(T, MRI, STI, false) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86MachObjectWriter(/*Is64Bit=*/false,
                                     MachO::CPU_TYPE_I386,
                                     MachO::CPU_SUBTYPE_I386_ALL);
  }

  /// Generate the compact unwind encoding for the CFI instructions.
  uint32_t generateCompactUnwindEncoding(
                             ArrayRef<MCCFIInstruction> Instrs) const override {
    return generateCompactUnwindEncodingImpl(Instrs);
  }
};

class DarwinX86_64AsmBackend : public DarwinX86AsmBackend {
  const MachO::CPUSubTypeX86 Subtype;
public:
  DarwinX86_64AsmBackend(const Target &T, const MCRegisterInfo &MRI,
                         const MCSubtargetInfo &STI, MachO::CPUSubTypeX86 st)
      : DarwinX86AsmBackend(T, MRI, STI, true), Subtype(st) {}

  std::unique_ptr<MCObjectTargetWriter>
  createObjectTargetWriter() const override {
    return createX86MachObjectWriter(/*Is64Bit=*/true, MachO::CPU_TYPE_X86_64,
                                     Subtype);
  }

  /// Generate the compact unwind encoding for the CFI instructions.
  uint32_t generateCompactUnwindEncoding(
                             ArrayRef<MCCFIInstruction> Instrs) const override {
    return generateCompactUnwindEncodingImpl(Instrs);
  }
};

} // end anonymous namespace

MCAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
                                           const MCSubtargetInfo &STI,
                                           const MCRegisterInfo &MRI,
                                           const MCTargetOptions &Options) {
  const Triple &TheTriple = STI.getTargetTriple();
  if (TheTriple.isOSBinFormatMachO())
    return new DarwinX86_32AsmBackend(T, MRI, STI);

  if (TheTriple.isOSWindows() && TheTriple.isOSBinFormatCOFF())
    return new WindowsX86AsmBackend(T, false, STI);

  uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TheTriple.getOS());

  if (TheTriple.isOSIAMCU())
    return new ELFX86_IAMCUAsmBackend(T, OSABI, STI);

  return new ELFX86_32AsmBackend(T, OSABI, STI);
}

MCAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
                                           const MCSubtargetInfo &STI,
                                           const MCRegisterInfo &MRI,
                                           const MCTargetOptions &Options) {
  const Triple &TheTriple = STI.getTargetTriple();
  if (TheTriple.isOSBinFormatMachO()) {
    MachO::CPUSubTypeX86 CS =
        StringSwitch<MachO::CPUSubTypeX86>(TheTriple.getArchName())
            .Case("x86_64h", MachO::CPU_SUBTYPE_X86_64_H)
            .Default(MachO::CPU_SUBTYPE_X86_64_ALL);
    return new DarwinX86_64AsmBackend(T, MRI, STI, CS);
  }

  if (TheTriple.isOSWindows() && TheTriple.isOSBinFormatCOFF())
    return new WindowsX86AsmBackend(T, true, STI);

  uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TheTriple.getOS());

  if (TheTriple.getEnvironment() == Triple::GNUX32)
    return new ELFX86_X32AsmBackend(T, OSABI, STI);
  return new ELFX86_64AsmBackend(T, OSABI, STI);
}


text:
package http

import (
	"bytes"
	"image"
	"image/jpeg"
	"image/png"
	"net/http"
	"os"
	"path"
	"strconv"

	"github.com/pkg/errors"

	"github.com/disintegration/imaging"
	"github.com/labstack/echo"
	log "github.com/sirupsen/logrus"
)

func LineImgHandler() func(c echo.Context) error {
	return func(c echo.Context) error {
		filename := c.Param("filename")
		filepath := "../line_imgs/" + filename
		sizeParam := c.Param("size")
		if sizeParam == "" {
			return c.File(filepath)
		}

		size, err := strconv.Atoi(sizeParam)
		if err != nil {
			log.Error(err)
			return err
		}

		ext := path.Ext(filename)
		if ext == "" || (ext != ".png" && ext != ".jpg" && ext != ".jpeg") {
			return errors.Errorf("Invalid extension '%s' in filename '%s'", ext, filename)
		}

		reader, err := os.Open(filepath)
		if err != nil {
			log.Error(err)
			return err
		}
		defer reader.Close()
		image, _, err := image.Decode(reader)
		if err != nil {
			log.Errorf("Error trying to decode image file %s: %s", filepath, err)
			return err
		}

		newImg := imaging.Resize(image, size, 0, imaging.Lanczos)
		buff := new(bytes.Buffer)
		var contentType string
		if ext == ".png" {
			contentType = "image/png"
			err = png.Encode(buff, newImg)
			if err != nil {
				log.Errorf("Error trying to encode '%s' to png: %s", filepath, err)
				return err
			}
		} else {
			contentType = "image/jpeg"
			err = jpeg.Encode(buff, newImg, nil)
			if err != nil {
				log.Errorf("Error trying to encode '%s' to jpeg: %s", filepath, err)
				return err
			}
		}
		newImgReader := bytes.NewReader(buff.Bytes())
		return c.Stream(http.StatusOK, contentType, newImgReader)
	}
}


text:
  Wolfersdorf est
       un village
       localisé dans le département de Haut-Rhin en Alsace. On dénombrait 380 habitants en 2008.

À proximité de Wolfersdorf sont situées les villes de
Traubach-le-Bas localisée à 1 km, 468 habitants,
Hagenbach située à 3 km, 675 habitants,
Elbach à 2 km, 270 habitants,
Gommersdorf située à 1 km, 367 habitants,
Manspach à 2 km, 514 habitants,
Buethwiller située à 3 km, 273 habitants,
 entre autres. De plus, Wolfersdorf est située à seulement 20 km de Mulhouse.

Si vous pensez venir habiter à Wolfersdorf, vous pourrez aisément trouver une maison à vendre.

Le parc d'habitations, à Wolfersdorf, se décomposait en 2011 en 45 appartements et 121 maisons soit
 un marché relativement équilibré.


text:
namespace base {
class Clock;
}  // namespace base

namespace chromeos {

namespace tether {

// Records a metric which tracks the amount of time that users spend connected
// to Tether hotspots.
class HotspotUsageDurationTracker : public ActiveHost::Observer {
 public:
  explicit HotspotUsageDurationTracker(ActiveHost* active_host,
                                       base::Clock* clock);

  HotspotUsageDurationTracker(const HotspotUsageDurationTracker&) = delete;
  HotspotUsageDurationTracker& operator=(const HotspotUsageDurationTracker&) =
      delete;

  virtual ~HotspotUsageDurationTracker();

 protected:
  // ActiveHost::Observer:
  void OnActiveHostChanged(
      const ActiveHost::ActiveHostChangeInfo& change_info) override;

 private:
  void HandleUnexpectedCurrentSession(
      const ActiveHost::ActiveHostStatus& active_host_status);

  ActiveHost* active_host_;
  base::Clock* clock_;

  base::Time last_connection_start_;
};

}  // namespace tether

}  // namespace chromeos

#endif  // ASH_COMPONENTS_TETHER_HOTSPOT_USAGE_DURATION_TRACKER_H_


text:
<?php

namespace Qcm\SalleTPBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Salle
 */
class Salle
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $batiment;

    /**
     * @var integer
     */
    private $etage;

    /**
     * @var integer
     */
    private $numero;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $ordinateurs;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->ordinateurs = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set batiment
     *
     * @param string $batiment
     * @return Salle
     */
    public function setBatiment($batiment)
    {
        $this->batiment = $batiment;

        return $this;
    }

    /**
     * Get batiment
     *
     * @return string
     */
    public function getBatiment()
    {
        return $this->batiment;
    }

    /**
     * Set etage
     *
     * @param integer $etage
     * @return Salle
     */
    public function setEtage($etage)
    {
        $this->etage = $etage;

        return $this;
    }

    /**
     * Get etage
     *
     * @return integer
     */
    public function getEtage()
    {
        return $this->etage;
    }

    /**
     * Set numero
     *
     * @param integer $numero
     * @return Salle
     */
    public function setNumero($numero)
    {
        $this->numero = $numero;

        return $this;
    }

    /**
     * Get numero
     *
     * @return integer
     */
    public function getNumero()
    {
        return $this->numero;
    }

    /**
     * Add ordinateurs
     *
     * @param \Qcm\SalleTPBundle\Entity\Ordinateur $ordinateurs
     * @return Salle
     */
    public function addOrdinateur(\Qcm\SalleTPBundle\Entity\Ordinateur $ordinateurs)
    {
        $this->ordinateurs[] = $ordinateurs;
	$ordinateurs->setSalle($this);
        return $this;
    }

    /**
     * Remove ordinateurs
     *
     * @param \Qcm\SalleTPBundle\Entity\Ordinateur $ordinateurs
     */
    public function removeOrdinateur(\Qcm\SalleTPBundle\Entity\Ordinateur $ordinateurs)
    {
        $this->ordinateurs->removeElement($ordinateurs);
    }

    /**
     * Get ordinateurs
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getOrdinateurs()
    {
        return $this->ordinateurs;
    }

   public function __toString()
   {
        return $this->batiment.''.$this->etage.'.'.$this->numero;
   }

}