473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A Deterministic Generic Collection

JAL
Here is my first attempt at a deterministic collection using Generics,
apologies for C#. I will try to convert to C++/cli.

using System;
using System.Collections.Generic;
using System.Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public abstract class Disposable : IDisposable
{
protected bool disposed = false;

// subclass needs to implement these two methods
abstract protected void DisposeManagedResources();
abstract protected void DisposeUnmanagedResources();

public virtual void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
~Disposable() // maps to finalize
{
Dispose(false);
}
}

// generic method to invoke
public interface IInvoke
{
void Invoke();
}

// concrete class to store
class PrintWrapper : Disposable, IDisposable, IInvoke
{
protected override void DisposeManagedResources()
{
//Console.WriteLine("Disposed Managed Resources.");
}
protected override void DisposeUnmanagedResources()
{
Console.WriteLine("Disposed Unmanaged Resources.");
}
public void Invoke()
{
if (disposed) { throw new ObjectDisposedException("Wrapper"); }
// mimic some type of unmanaged action
Console.WriteLine("Print.");
}
}

// generic collection
public class JALGenericCollection<T> : Disposable, IInvoke where T :
IDisposable, IInvoke
{
private readonly object syncLock = new object();
private List<T> list = new List<T>();
public JALGenericCollection() { ;}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
public void Add(T d)
{
if (d != null)
{
lock (syncLock)
{
list.Add(d);
}
}
else { throw new ArgumentException(); }
}
public void Clear()
{
lock (syncLock)
{
foreach (IDisposable d in list)
{
d.Dispose();
}
list.Clear();
}
}
// return an array of immutable Data struct
public void Invoke()
{
if (disposed) { throw new
ObjectDisposedException("JALGenericCollection"); }
// no one can add or delete during this critical section
lock (syncLock)
{
foreach (IInvoke i in list)
{
i.Invoke();
}
}
}
protected override void DisposeManagedResources()
{
lock (syncLock)
{
foreach (IDisposable d in list)
{
d.Dispose();
}
}
}
protected override void DisposeUnmanagedResources()
{
// do nothing
}
}
class Program
{
static void Main(string[] args)
{
using (JALGenericCollection<PrintWrapper> jalg =
new JALGenericCollection<PrintWrapper>())
{
jalg.Add(new PrintWrapper());
jalg.Add(new PrintWrapper());
jalg.Add(new PrintWrapper());
jalg.Invoke();
jalg.Clear();
jalg.Add(new PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement
IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement
IInvoke
}
Console.ReadLine();
}
}
}

Have fun!
Dec 17 '05 #1
8 1812
Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
(your feedback is welcome):

using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
Dispose(true);
GC::SuppressFinalize(this);
}
private:
void Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
internal ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
void Invoke()
{
if (disposed)
{
throw gcnew
ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
non-static fields in their declarations:
initonly Object ^syncLock = gcnew Object^();
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
non-static fields in their declarations:
List<T^> ^list = gcnew List<T^>();
public:
JALGenericCollection()
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T ^d)
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
list->Add(d);
}
finally
{

System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable d in list)
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
// return an array of immutable Data struct
void Invoke()
{
if (disposed)
{
throw gcnew
ObjectDisposedException("JALGenericCollection");
}
// no one can add or delete during this critical
section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IInvoke i in list)
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable d in list)
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
internal ref class Program
{
static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> ^jalg = gcnew
JALGenericCollection<PrintWrapper^>();
try
{
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
jalg->Clear();
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
//jalg.Add(new InvokeWrapper()); //
error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error,
not implement IInvoke
}
finally
{
}
Console::ReadLine();
}
};
}

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
Here is my first attempt at a deterministic collection using Generics,
apologies for C#. I will try to convert to C++/cli.

using System;
using System.Collections.Generic;
using System.Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public abstract class Disposable : IDisposable
{
protected bool disposed = false;

// subclass needs to implement these two methods
abstract protected void DisposeManagedResources();
abstract protected void DisposeUnmanagedResources();

public virtual void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
~Disposable() // maps to finalize
{
Dispose(false);
}
}

// generic method to invoke
public interface IInvoke
{
void Invoke();
}

// concrete class to store
class PrintWrapper : Disposable, IDisposable, IInvoke
{
protected override void DisposeManagedResources()
{
//Console.WriteLine("Disposed Managed Resources.");
}
protected override void DisposeUnmanagedResources()
{
Console.WriteLine("Disposed Unmanaged Resources.");
}
public void Invoke()
{
if (disposed) { throw new ObjectDisposedException("Wrapper"); }
// mimic some type of unmanaged action
Console.WriteLine("Print.");
}
}

// generic collection
public class JALGenericCollection<T> : Disposable, IInvoke where T :
IDisposable, IInvoke
{
private readonly object syncLock = new object();
private List<T> list = new List<T>();
public JALGenericCollection() { ;}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
public void Add(T d)
{
if (d != null)
{
lock (syncLock)
{
list.Add(d);
}
}
else { throw new ArgumentException(); }
}
public void Clear()
{
lock (syncLock)
{
foreach (IDisposable d in list)
{
d.Dispose();
}
list.Clear();
}
}
// return an array of immutable Data struct
public void Invoke()
{
if (disposed) { throw new
ObjectDisposedException("JALGenericCollection"); }
// no one can add or delete during this critical section
lock (syncLock)
{
foreach (IInvoke i in list)
{
i.Invoke();
}
}
}
protected override void DisposeManagedResources()
{
lock (syncLock)
{
foreach (IDisposable d in list)
{
d.Dispose();
}
}
}
protected override void DisposeUnmanagedResources()
{
// do nothing
}
}
class Program
{
static void Main(string[] args)
{
using (JALGenericCollection<PrintWrapper> jalg =
new JALGenericCollection<PrintWrapper>())
{
jalg.Add(new PrintWrapper());
jalg.Add(new PrintWrapper());
jalg.Add(new PrintWrapper());
jalg.Invoke();
jalg.Clear();
jalg.Add(new PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement
IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement
IInvoke
}
Console.ReadLine();
}
}
}

Have fun!

Dec 17 '05 #2
JAL
David... Pretty cool. I had to make a few changes as documented below, but it
was helpful! The main logic change is the conversion of using to value
semantics.

// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>()) {...} -->

JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics

Here is the updated code:

// DeterminedCPPCollection.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
_Dispose(true);
GC::SuppressFinalize(this);
}
private:
void _Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
_Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
public ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
virtual void Invoke() // added virtual
{
if (disposed)
{
throw gcnew ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke // internal ->
public
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
initonly Object ^syncLock;
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
List<T> ^list; // ^T to T
public:
JALGenericCollection(): syncLock(gcnew Object()), list(gcnew List<T>())
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T d) // ^d --> d
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
list->Add(d);
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IDisposable^ d in list) // d --> ^d
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}

virtual void Invoke() // added virtual
{
// no one can add or delete during this critical section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IInvoke^ i in list) // IInvoke to IInvoke^
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable^ d in list) // IDisposable --> IDisposable^
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
public ref class Program // internal --> public
{
public: static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
// equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
};
}

int main(array<System::String ^> ^args)
{
try {
DeterminedGenericCollection::Program::Main(nullptr );
}
catch(System::Exception^ e) {
Console::WriteLine(e);
}
Console::ReadLine();
}
"David Anton" wrote:
Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
(your feedback is welcome):

Dec 18 '05 #3
Thanks for your feedback!
We've updated the latest build of Instant C++ to notate the reference types
correctly in "for each" headers. The issue with references to the generic
typename T will require further research (i.e., is T always specified with
value semantics?), but should be addressed soon.

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
David... Pretty cool. I had to make a few changes as documented below, but it
was helpful! The main logic change is the conversion of using to value
semantics.

// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>()) {...} -->

JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics

Here is the updated code:

// DeterminedCPPCollection.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
_Dispose(true);
GC::SuppressFinalize(this);
}
private:
void _Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
_Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
public ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
virtual void Invoke() // added virtual
{
if (disposed)
{
throw gcnew ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke // internal ->
public
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
initonly Object ^syncLock;
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
List<T> ^list; // ^T to T
public:
JALGenericCollection(): syncLock(gcnew Object()), list(gcnew List<T>())
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T d) // ^d --> d
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
list->Add(d);
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IDisposable^ d in list) // d --> ^d
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}

virtual void Invoke() // added virtual
{
// no one can add or delete during this critical section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IInvoke^ i in list) // IInvoke to IInvoke^
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable^ d in list) // IDisposable --> IDisposable^
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
public ref class Program // internal --> public
{
public: static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
// equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
};
}

int main(array<System::String ^> ^args)
{
try {
DeterminedGenericCollection::Program::Main(nullptr );
}
catch(System::Exception^ e) {
Console::WriteLine(e);
}
Console::ReadLine();
}
"David Anton" wrote:
Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
(your feedback is welcome):

Dec 18 '05 #4
JAL
Hi David... There really is no easy way to convert C# using to C++/cli value
type's exception safe destructor unless you break the using clause into an
anonymous method (available in C++/cli?) or a separate method. So the simple
solution I suppose is what your converter proposes which is:

JALGenericCollection<PrintWrapper^>^ jalg=
gcnew JALGenericCollection<PrintWrapper^>();
try {
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
throw gcnew System::Exception(); // TEST
jalg->Clear();
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
finally {
if (jalg != nullptr) {delete jalg;}
}

"David Anton" wrote:
Thanks for your feedback!
We've updated the latest build of Instant C++ to notate the reference types
correctly in "for each" headers. The issue with references to the generic
typename T will require further research (i.e., is T always specified with
value semantics?), but should be addressed soon.

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
David... Pretty cool. I had to make a few changes as documented below, but it
was helpful! The main logic change is the conversion of using to value
semantics.

// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>()) {...} -->

JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics

Here is the updated code:

// DeterminedCPPCollection.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
_Dispose(true);
GC::SuppressFinalize(this);
}
private:
void _Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
_Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
public ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
virtual void Invoke() // added virtual
{
if (disposed)
{
throw gcnew ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke // internal ->
public
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
initonly Object ^syncLock;
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
List<T> ^list; // ^T to T
public:
JALGenericCollection(): syncLock(gcnew Object()), list(gcnew List<T>())
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T d) // ^d --> d
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
list->Add(d);
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IDisposable^ d in list) // d --> ^d
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}

virtual void Invoke() // added virtual
{
// no one can add or delete during this critical section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IInvoke^ i in list) // IInvoke to IInvoke^
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable^ d in list) // IDisposable --> IDisposable^
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
public ref class Program // internal --> public
{
public: static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
// equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
};
}

int main(array<System::String ^> ^args)
{
try {
DeterminedGenericCollection::Program::Main(nullptr );
}
catch(System::Exception^ e) {
Console::WriteLine(e);
}
Console::ReadLine();
}
"David Anton" wrote:
Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
(your feedback is welcome):

Dec 18 '05 #5
References to the generic type parameters are now without the 'hat'.
Thanks again for your feedback!
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
Hi David... There really is no easy way to convert C# using to C++/cli value
type's exception safe destructor unless you break the using clause into an
anonymous method (available in C++/cli?) or a separate method. So the simple
solution I suppose is what your converter proposes which is:

JALGenericCollection<PrintWrapper^>^ jalg=
gcnew JALGenericCollection<PrintWrapper^>();
try {
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
throw gcnew System::Exception(); // TEST
jalg->Clear();
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
finally {
if (jalg != nullptr) {delete jalg;}
}

"David Anton" wrote:
Thanks for your feedback!
We've updated the latest build of Instant C++ to notate the reference types
correctly in "for each" headers. The issue with references to the generic
typename T will require further research (i.e., is T always specified with
value semantics?), but should be addressed soon.

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
David... Pretty cool. I had to make a few changes as documented below, but it
was helpful! The main logic change is the conversion of using to value
semantics.

// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>()) {...} -->

JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics

Here is the updated code:

// DeterminedCPPCollection.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
_Dispose(true);
GC::SuppressFinalize(this);
}
private:
void _Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
_Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
public ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
virtual void Invoke() // added virtual
{
if (disposed)
{
throw gcnew ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke // internal ->
public
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
initonly Object ^syncLock;
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
List<T> ^list; // ^T to T
public:
JALGenericCollection(): syncLock(gcnew Object()), list(gcnew List<T>())
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T d) // ^d --> d
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
list->Add(d);
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IDisposable^ d in list) // d --> ^d
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}

virtual void Invoke() // added virtual
{
// no one can add or delete during this critical section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IInvoke^ i in list) // IInvoke to IInvoke^
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable^ d in list) // IDisposable --> IDisposable^
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
public ref class Program // internal --> public
{
public: static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
// equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
};
}

int main(array<System::String ^> ^args)
{
try {
DeterminedGenericCollection::Program::Main(nullptr );
}
catch(System::Exception^ e) {
Console::WriteLine(e);
}
Console::ReadLine();
}
"David Anton" wrote:

> Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
> (your feedback is welcome):
>

Dec 18 '05 #6
JAL
Oh well, this seems to work also:

if(true) {
JALGenericCollection<PrintWrapper^> jalg;
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
}

"JAL" wrote:
Hi David... There really is no easy way to convert C# using to C++/cli value
type's exception safe destructor unless you break the using clause into an
anonymous method (available in C++/cli?) or a separate method. So the simple
solution I suppose is what your converter proposes which is:

JALGenericCollection<PrintWrapper^>^ jalg=
gcnew JALGenericCollection<PrintWrapper^>();
try {
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
throw gcnew System::Exception(); // TEST
jalg->Clear();
jalg->Add(gcnew PrintWrapper());
jalg->Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
finally {
if (jalg != nullptr) {delete jalg;}
}

"David Anton" wrote:
Thanks for your feedback!
We've updated the latest build of Instant C++ to notate the reference types
correctly in "for each" headers. The issue with references to the generic
typename T will require further research (i.e., is T always specified with
value semantics?), but should be addressed soon.

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"JAL" wrote:
David... Pretty cool. I had to make a few changes as documented below, but it
was helpful! The main logic change is the conversion of using to value
semantics.

// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>()) {...} -->

JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics

Here is the updated code:

// DeterminedCPPCollection.cpp : main project file.

#include "stdafx.h"

using namespace System;
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;

namespace DeterminedGenericCollection
{
// I got tired of copy and pasting IDisposable
// reusable base class
public ref class Disposable abstract: IDisposable
{
public protected:
bool disposed;

// subclass needs to implement these two methods
virtual void DisposeManagedResources() abstract;
virtual void DisposeUnmanagedResources() abstract;

~Disposable()
{
_Dispose(true);
GC::SuppressFinalize(this);
}
private:
void _Dispose(Boolean disposing)
{
if (!this->disposed)
{
if (disposing) // called from Dispose
{
DisposeManagedResources();
}
DisposeUnmanagedResources();
}
disposed = true;
}
!Disposable() // maps to finalize
{
_Dispose(false);
}
};

// generic method to invoke
public interface class IInvoke
{
void Invoke();
};

// concrete class to store
public ref class PrintWrapper : Disposable, IDisposable, IInvoke
{
public protected:
virtual void DisposeManagedResources() override
{
//Console.WriteLine("Disposed Managed Resources.");
}
virtual void DisposeUnmanagedResources() override
{
Console::WriteLine("Disposed Unmanaged Resources.");
}
public:
virtual void Invoke() // added virtual
{
if (disposed)
{
throw gcnew ObjectDisposedException("Wrapper");
}
// mimic some type of unmanaged action
Console::WriteLine("Print.");
}
};

// generic collection
generic<typename T> where T : IDisposable, IInvoke
public ref class JALGenericCollection : Disposable, IInvoke // internal ->
public
{
private:
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
initonly Object ^syncLock;
//TODO: INSTANT C++ TODO TASK: C++ does not allow initialization of
// non-static fields in their declarations:
List<T> ^list; // ^T to T
public:
JALGenericCollection(): syncLock(gcnew Object()), list(gcnew List<T>())
{
;
}
// ASSERT d is not null
// ASSERT no object holds a reference to
// d outside of this class
// USAGE Add(new MyClass()); ** newed reference idiom **
// where MyClass implements IDisposable and IInvoke
void Add(T d) // ^d --> d
{
if (d != nullptr)
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
list->Add(d);
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
else
{
throw gcnew ArgumentException();
}
}
void Clear()
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IDisposable^ d in list) // d --> ^d
{
delete d;
}
list->Clear();
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}

virtual void Invoke() // added virtual
{
// no one can add or delete during this critical section
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
if (disposed)
{
throw gcnew ObjectDisposedException("JALGenericCollection");
}
for each (IInvoke^ i in list) // IInvoke to IInvoke^
{
i->Invoke();
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
public protected:
virtual void DisposeManagedResources() override
{
//INSTANT C++ NOTE: The following 'lock' block is replaced by its VC++
// equivalent:
// lock (syncLock)
System::Threading::Monitor::Enter(syncLock);
try
{
for each (IDisposable^ d in list) // IDisposable --> IDisposable^
{
delete d;
}
}
finally
{
System::Threading::Monitor::Exit(syncLock);
}
}
virtual void DisposeUnmanagedResources() override
{
// do nothing
}
};
public ref class Program // internal --> public
{
public: static void Main(array<String^> ^args)
{
//INSTANT C++ NOTE: The following 'using' block is replaced by its VC++
// equivalent:
// using (JALGenericCollection<PrintWrapper> jalg = new
// JALGenericCollection<PrintWrapper>())
JALGenericCollection<PrintWrapper^> jalg; // converted to value semantics
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
throw gcnew System::Exception(); // TEST
jalg.Clear();
jalg.Add(gcnew PrintWrapper());
jalg.Invoke();
//jalg.Add(new InvokeWrapper()); // error,not implement IDispose
//jalg.Add(new DisposeWrapper()); // error, not implement IInvoke
}
};
}

int main(array<System::String ^> ^args)
{
try {
DeterminedGenericCollection::Program::Main(nullptr );
}
catch(System::Exception^ e) {
Console::WriteLine(e);
}
Console::ReadLine();
}
"David Anton" wrote:

> Here's the C++/CLI version produced with our Instant C++ C# to C++ converter
> (your feedback is welcome):
>

Dec 19 '05 #7
David Anton wrote:
~Disposable()
{
Dispose(true);
GC::SuppressFinalize(this);
}


C++/CLI destructors automtically call SuppressFinalize. Only very early
(Beta 1) C++/CLI compilers required us to manually call SupressFinalize.
It would be very counter intuitive to do this manually for every single
destructor. Of course it doesn't do any harm to duplicate it.

Also, C++/CLI compilers automatically create Dispose(bool), so you don't
have to write that either. A C++/CLI destructor is equivalent with this:

public:
virtual void Dispose() sealed {
this->Dispose(true);
System::GC::SuppressFinalize(this);
}

Tom
Dec 19 '05 #8
I agree - but for a conversion from C#, I think it's safer to include the
equivalent, even though redundant, elements.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter

"Tamas Demjen" wrote:
David Anton wrote:
~Disposable()
{
Dispose(true);
GC::SuppressFinalize(this);
}


C++/CLI destructors automtically call SuppressFinalize. Only very early
(Beta 1) C++/CLI compilers required us to manually call SupressFinalize.
It would be very counter intuitive to do this manually for every single
destructor. Of course it doesn't do any harm to duplicate it.

Also, C++/CLI compilers automatically create Dispose(bool), so you don't
have to write that either. A C++/CLI destructor is equivalent with this:

public:
virtual void Dispose() sealed {
this->Dispose(true);
System::GC::SuppressFinalize(this);
}

Tom

Dec 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1747
by: dcew | last post by:
Here's what I'm trying to understand; how can you store a generic collection in a variable/field? If I have an abstract generic collection class as follows... public abstract class...
8
3273
by: Steven Cummings | last post by:
Hello, I've scoured this usenet group and didn't find anything specific to my problem, so hopefully this won't be a repeated question. I'm all but certain it's not. I would like to *declare*...
3
5520
by: snesbit | last post by:
I have a structure called SearchAreaListItem. The structure has some properties. The application implements this as a collection.generic.list(of SearchAreaListItem) I load the collection up ...
2
9848
by: AdawayNoSpam | last post by:
Said that I have the following class Class MyRootClass(Of T) End Class Class MySubClass1(Of T) Inherits MyRootClass(Of T) End Class
2
1462
by: Angel Mateos | last post by:
I have this structure: Class ElemBase Class Elem1 : Inherits ElemBase Class ColecBase(Of GenElem As {ElemBase, New}) : Inherits System.ComponentModel.BindingList(Of GenElem) Class Colec1...
4
7550
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed...
1
2574
by: Kuldeep | last post by:
Framework: Visual Studio 2005, ASP.NET Programing Language: C#.NET I am using a Generic List Collection to fetch a particular master data from the database. Once collected, I use this Collection...
5
2154
by: sloan | last post by:
I've noticed alot of people tacking on a "T" for a generic abled version of an older class. Ex: 1.1 Code IDataStore
2
4161
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.