Ignore:
Timestamp:
Feb 3, 2010, 5:07:51 PM (12 years ago)
Author:
arnold
Message:

Added references to some P2PProjects, so the global SLN compiles correctly again

Location:
trunk/CrypPlugins/PeerToPeerJobs
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/PeerToPeerJobs/JobResult.cs

    r1129 r1130  
    88namespace Cryptool.Plugins.PeerToPeer.Jobs
    99{
    10     public class JobResult<JobType, JobResultType>
    11         where JobType : IJobPart<JobType>
     10    public class JobResult<JobResultType> : IJobResult<JobResultType>
    1211    {
    1312        #region Variables
    1413
    15         private JobType job;
    16         public JobType Job
    17         {
    18             get { return this.job; }
    19             private set{this.job = value;}
     14        private int jobId;
     15        public int JobId
     16        {
     17            get {  return this.jobId; }
     18            set { this.jobId = value; }
    2019        }
    2120        private bool isIntermediateJobResult;
     
    2322        {
    2423            get { return this.isIntermediateJobResult;}
    25             private set { this.isIntermediateJobResult = value; }
     24            set { this.isIntermediateJobResult = value; }
    2625        }
    2726        private TimeSpan processingTime;
     
    2928        {
    3029            get { return this.processingTime;}
    31             private set { this.processingTime = value; }
     30            set { this.processingTime = value; }
    3231        }
    3332        private JobResultType result;
     
    3534        {
    3635            get{return this.result;}
    37             private set { this.result = value; }
     36            set { this.result = value; }
    3837        }
    3938
     
    4342        /// Creates a new JobResult (this is an endresul!)
    4443        /// </summary>
    45         /// <param name="job">job for which you have a result</param>
     44        /// <param name="jobId">jobId for which you have a result</param>
    4645        /// <param name="result">result of the job (e.g. simple conclusion, list, complex data structure)</param>
    4746        /// <param name="processingTime">Timespan between begin and end of processing the job</param>
    48         public JobResult(JobType job, JobResultType result, TimeSpan processingTime)
    49             :this(job,result,processingTime,false)
     47        public JobResult(int jobId, JobResultType result, TimeSpan processingTime)
     48            :this(jobId,result,processingTime,false)
    5049        { }
    5150
     
    5352        /// Creates a new JobResult (you can choose if this is only an intermediate result or the endresult)
    5453        /// </summary>
    55         /// <param name="job">job for which you have a result</param>
     54        /// <param name="jobId">jobId for which you have a result</param>
    5655        /// <param name="result">result of the job (e.g. simple conclusion, list, complex data structure)</param>
    5756        /// <param name="processingTime">Timespan between begin and end of processing the job</param>
    5857        /// <param name="isIntermediateResult">Is this is only an intermediate result, set this parameter to true, otherwise choose false</param>
    59         public JobResult(JobType job, JobResultType result, TimeSpan processingTime, bool isIntermediateResult)
    60         {
    61             this.Job = job;
     58        public JobResult(int jobId, JobResultType result, TimeSpan processingTime, bool isIntermediateResult)
     59        {
     60            this.JobId = jobId;
    6261            this.Result = result;
    6362            this.ProcessingTime = processingTime;
     
    6766        #region Serialization methods
    6867
    69         /* 1 Byte:  serialized Job length
    70          * x Bytes: serialized Job data
    71          * 1 Byte:  serialized Job Result length
     68        /* 4 Bytes: serialized JobId
     69         * 4 Bytes: serialized Job Result length
    7270         * y Bytes: serialized Job Result data
    7371         * 4 Bytes: isIntermedResult
     
    7674         * 4 Bytes: procTime.Minutes
    7775         * 4 Bytes: procTime.Seconds
    78          * 4 Byte:s procTime.Milliseconds */
     76         * 4 Bytes: procTime.Milliseconds */
    7977        /// <summary>
    8078        /// Serializes the whole class, so you can recreate this instance elsewhere by dint of this byte[]
     
    8785            try
    8886            {
    89                 /* Serialize job via Reflection */
    90                 //byte[] serializedJob = GetSerializationViaReflection(this.Job);
    91                 byte[] serializedJob = this.Job.Serialize();
    92                 byte[] serializedJobLen = BitConverter.GetBytes(serializedJob.Length);
    93                 memStream.Write(serializedJobLen, 0, serializedJobLen.Length);
    94                 memStream.Write(serializedJob, 0, serializedJob.Length);
     87                /* Serialize jobId */
     88                byte[] intJobId = BitConverter.GetBytes(this.JobId);
     89                memStream.Write(intJobId, 0, intJobId.Length);
    9590
    9691                /* Serialize job result via Reflection */
     
    140135            try
    141136            {
    142                 /* Deserialize Job data */
     137                /* Deserialize JobId */
    143138                byte[] readInt = new byte[4];
    144139                memStream.Read(readInt, 0, readInt.Length);
    145                 int serializedDataLen = BitConverter.ToInt32(readInt,0);
    146                 byte[] serializedJob = new byte[serializedDataLen];
    147                 memStream.Read(serializedJob,0,serializedJob.Length);
    148                 //this.Job = (JobType)GetDeserializationViaReflection(serializedJob, this.Job);
    149                 this.Job = this.Job.Deserialize(serializedJob);
     140                this.JobId = BitConverter.ToInt32(readInt,0);
    150141
    151142                /* Deserialize Job result data */
    152143                memStream.Read(readInt,0,readInt.Length);
    153                 serializedDataLen = BitConverter.ToInt32(readInt,0);
     144                int serializedDataLen = BitConverter.ToInt32(readInt,0);
    154145                byte[] serializedJobResultByte = new byte[serializedDataLen];
    155146                memStream.Read(serializedJobResultByte, 0, serializedJobResultByte.Length);
  • trunk/CrypPlugins/PeerToPeerJobs/PeerToPeerJobs.csproj

    r1129 r1130  
    4848  </ItemGroup>
    4949  <ItemGroup>
     50    <Compile Include="IJobResult.cs" />
    5051    <Compile Include="JobResult.cs" />
    5152    <Compile Include="IJobStack.cs" />
Note: See TracChangeset for help on using the changeset viewer.